Visio 2003 introduced a new Reviewer & Markup feature that allows users to add comments to diagrams. A typical question we are asked is “How do I print the comments?” This capability was not included in the markup feature, but our Product Support team has published a solution in a Knowledge Base article:
http://support.microsoft.com/kb/898514/en-us
The solution is a VBA macro that you can add to your document to programmatically collect the comment information and put it into a new shape in the diagram. Please follow the link for detailed instructions and the code. The shape is placed off the page at first. You can resize the shape, format the text to your liking and then move the shape into the printed page region.
The code operates on the current page and also any reviewer pages that may overlay it. Comments are found in the Annotation section of the page’s ShapeSheet.
This “comment report” is one way of addressing the need for printing comments. If you use comments in your diagrams, please tell us how you surface them or how you would like to see Visio display and print them.
I would like to be able to print out the diagram just like you see it, with the comments show as the user initials and a number (e.g. SAS2). This would make the comments list that the macro produces would be more useful, as you could then look at the diagram printout and see the what part of the diagram the comment is referring to.
Hi Scott,
Thanks for the good suggestion.
Mark Nelson
I'm getting an error when I try to run this macro. "Run-time error '438': Object doesn't support this property or method" and when I click Debug it goes to this line: iAutoSize = pag.AutoSize 'new, and when I right click and select define I get "Identifier under cursor is not recognized".
Is there a library missing? What's the fix, 'cause this looks like a really useful function.
I get an error with the following line:
iAutoSize = pag.AutoSize 'new
Nothing succeeds like never giving up. I was able to sucessfully create a macro that produced the comments. Make sure you look to the FAR left (off the page) for the comments then select them,make the selection smaller, then drag the comments onto your page.
I combined 2 macros that I found on the Internet. One this the one you have been using w/theiAutosize error, and other, which had multiple compile errors, but replaced the end of the macro differently than the first. I discarded the everything from the iAutosize error to the end of the macro and replaced it with the end of the other macro I had found, and voila!
Here it is. Good Luck!
BJ in Rhode Island
Public Sub GetComments()
Dim pagMarkup As Visio.Page
Dim pag As Visio.Page
Dim shp As Visio.Shape
Dim sText As String
Dim iRow As Integer
Set pag = Visio.ActivePage
sText = "Reviewer" & vbTab & "Date" & vbTab & "Comment"
If pag.PageSheet.SectionExists(Visio.visSectionAnnotation, Visio.visExistsAnywhere) Then
For iRow = 0 To pag.PageSheet.RowCount(Visio.visSectionAnnotation) - 1
sText = sText & vbCrLf & pag.Document.DocumentSheet.CellsSRC(Visio.visSectionReviewer, pag.PageSheet.CellsSRC(Visio.visSectionAnnotation, iRow, Visio.visAnnotationReviewerID).ResultIU - 1, Visio.visReviewerInitials).ResultStr("")
sText = sText & pag.PageSheet.CellsSRC(Visio.visSectionAnnotation, iRow, Visio.visAnnotationMarkerIndex).ResultIU
sText = sText & vbTab & Format(pag.PageSheet.CellsSRC(Visio.visSectionAnnotation, iRow, Visio.visAnnotationDate).ResultIU, "ddddd")
sText = sText & vbTab & pag.PageSheet.CellsSRC(Visio.visSectionAnnotation, iRow, Visio.visAnnotationComment).ResultStr("")
Next iRow
End If
For Each pagMarkup In pag.Document.Pages
If pagMarkup.Type = visTypeMarkup Then
If pagMarkup.OriginalPage = pag Then
If pagMarkup.PageSheet.SectionExists(Visio.visSectionAnnotation, Visio.visExistsAnywhere) Then
sText = sText & vbCrLf
sText = sText & vbCrLf & pag.Document.DocumentSheet.CellsSRC(Visio.visSectionReviewer, pagMarkup.ReviewerID - 1, Visio.visReviewerName).ResultStr("")
For iRow = 0 To pagMarkup.PageSheet.RowCount(Visio.visSectionAnnotation) - 1
sText = sText & vbCrLf & pag.Document.DocumentSheet.CellsSRC(Visio.visSectionReviewer, pagMarkup.PageSheet.CellsSRC(Visio.visSectionAnnotation, iRow, Visio.visAnnotationReviewerID).ResultIU - 1, Visio.visReviewerInitials).ResultStr("")
sText = sText & pagMarkup.PageSheet.CellsSRC(Visio.visSectionAnnotation, iRow, Visio.visAnnotationMarkerIndex).ResultIU
sText = sText & vbTab & Format(pagMarkup.PageSheet.CellsSRC(Visio.visSectionAnnotation, iRow, Visio.visAnnotationDate).ResultIU, "ddddd")
sText = sText & vbTab & pagMarkup.PageSheet.CellsSRC(Visio.visSectionAnnotation, iRow, Visio.visAnnotationComment).ResultStr("")
Next pagMarkup
Set shp = pag.DrawRectangle(-pag.PageSheet.Cells("PageWidth").ResultIU, 0, 0, pag.PageSheet.Cells("PageHeight").ResultIU)
shp.Cells("Para.HorzAlign").Formula = "0"
shp.Cells("VerticalAlign").Formula = "0"
shp.Name = "Reviewers Comments"
shp.Text = sText
End Sub
Hi Everyone,
I need help, I can't show process engineering menu on existing drawing.
I created the visio drawing (2003 PROF.) not from Process Engineering, I took blank drawing. Then I copied some shapes that already applied with certain tag format from other drawing (other drawing has process engineering menu). My visio drawing already populated into a database based on shape's ID and need to adjust the tag format now. Does anyone know how to show process engineering menu on existing drawing?
Thank you very much for your help.
Best Regards,
Femiana
PS : personal contact : early.femiana@gmail.com
I use comments in my diagrams to provide additional, more detailed, information about a process in a chart. I have stopped using Visio and use PowerPoint inserting markup comments. These show on the printout as a box positioned on your drawing [a bit big, but they are there] and when you print, the page following your diagram/slide presents a list of all comments on the drawing page. Another option, it could be similar to what you see and print in Word with Markup on.
I have a workaround {PowerPoint] that works, but is less than ideal for using Visio; I would like to see something more useful.
cheers
Thanks BJ from Rhode Island: just copied and pasted.. Your macro works like a charm !