How to print comments that are inserted by reviewers when you use the Track Markup feature in Visio 2007 or in Visio 2003| Article ID | : | 898514 | | Last Review | : | November 14, 2006 | | Revision | : | 3.3 |
INTRODUCTIONThis article describes a macro that you can use to print comments that are inserted by reviewers. You can use this macro when you use the Track Markup feature in Microsoft Office Visio 2007 or in Microsoft Office Visio 2003. MORE INFORMATIONWhen you use the Track Markup feature in Visio, users who review the drawing can add proposed changes. Proposed changes are also known as markup. Markup includes shapes, ink shapes, and comments. When you print a drawing that contains markup, the comments that are inserted by the reviewers are not printed. Use the macro that is discussed in this article to print the comments that are inserted by the reviewers. The macro extracts the comments that are in the drawing, and then inserts the comments in a new shape. The new shape appears outside the drawing page. Resize the shape, and then drag the shape to the drawing page. When you print the drawing, the comments appear in the new shape that you added to the drawing. To create and to run the macro, follow these steps. Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. | 1. | Create the macro. To do this, follow these steps: | a. | Start Visio, and then open your drawing. | | b. | Press ALT+F11 to start Microsoft Visual Basic Editor. | | c. | On the Insert menu, click Module.
| | d. | Copy the following code, and then paste the code in the FileName - ModuleNumber (Code) window: 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 iRow
End If
End If
End If
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 | | e. | Press CTRL+S to save the drawing. | | f. | On the File menu, click Close and Return to Visio. |
| | 2. | Run the macro. To do this, follow these steps: | a. | On the Tools menu, point to Macros, and then click Macros. | | b. | In the Macro name list, click the macro that you created in step 1, and then click Run. The name of the macro is FileName.ModuleNumber.GetComments.
The macro inserts the comments in a new shape that appears to the left of the drawing page. |
| | 3. | Resize the shape that contains the comments, and then drag the shape to the drawing page. If you want, format the text in the shape. When you print your drawing, the comments appear in the shape in your drawing. |
APPLIES TO| • | Microsoft Office Visio Professional 2007 | | • | Microsoft Office Visio Standard 2007 | | • | Microsoft Office Visio Professional 2003 | | • | Microsoft Office Visio Standard 2003 |
Back to the top
| kbdisplay kbprint kbinfo kbhowto KB898514 |
| Other Support Options- Need More Help?
Contact a Support professional by E-mail, Online or Phone. - Customer Service
For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more. - Newsgroups
Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.
|
|