Microsoft KB Archive/898514

= 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

Article Last Modified on 11/14/2006

-

APPLIES TO


 * Microsoft Office Visio Professional 2007
 * Microsoft Office Visio Standard 2007
 * Microsoft Office Visio Professional 2003
 * Microsoft Office Visio Standard 2003

-





INTRODUCTION
This 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 INFORMATION
When 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.  Create the macro. To do this, follow these steps:  Start Visio, and then open your drawing. Press ALT+F11 to start Microsoft Visual Basic Editor. On the Insert menu, click Module. Copy the following code, and then paste the code in the  - Module  (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 = &quot;Reviewer&quot; & vbTab & &quot;Date&quot; & vbTab & &quot;Comment&quot;

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(&quot;&quot;) sText = sText & pag.PageSheet.CellsSRC(Visio.visSectionAnnotation, iRow, Visio.visAnnotationMarkerIndex).ResultIU sText = sText & vbTab & Format(pag.PageSheet.CellsSRC(Visio.visSectionAnnotation, iRow, Visio.visAnnotationDate).ResultIU, &quot;ddddd&quot;) sText = sText & vbTab & pag.PageSheet.CellsSRC(Visio.visSectionAnnotation, iRow, Visio.visAnnotationComment).ResultStr(&quot;&quot;) 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(&quot;&quot;) 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(&quot;&quot;) sText = sText & pagMarkup.PageSheet.CellsSRC(Visio.visSectionAnnotation, iRow, Visio.visAnnotationMarkerIndex).ResultIU sText = sText & vbTab & Format(pagMarkup.PageSheet.CellsSRC(Visio.visSectionAnnotation, iRow, Visio.visAnnotationDate).ResultIU, &quot;ddddd&quot;) sText = sText & vbTab & pagMarkup.PageSheet.CellsSRC(Visio.visSectionAnnotation, iRow, Visio.visAnnotationComment).ResultStr(&quot;&quot;) Next iRow End If End If End If Next pagMarkup

Set shp = pag.DrawRectangle(-pag.PageSheet.Cells(&quot;PageWidth&quot;).ResultIU, 0, 0, pag.PageSheet.Cells(&quot;PageHeight&quot;).ResultIU) shp.Cells(&quot;Para.HorzAlign&quot;).Formula = &quot;0&quot; shp.Cells(&quot;VerticalAlign&quot;).Formula = &quot;0&quot; shp.Name = &quot;Reviewers Comments&quot; shp.Text = sText End Sub

 Press CTRL+S to save the drawing. On the File menu, click Close and Return to Visio.</li></ol> </li> Run the macro. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> On the Tools menu, point to Macros, and then click Macros.</li> In the Macro name list, click the macro that you created in step 1, and then click Run. The name of the macro is .Module .GetComments.

The macro inserts the comments in a new shape that appears to the left of the drawing page.</li></ol> </li> 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.</li></ol>

Additional query words: vso2007 vso

Keywords: kbdisplay kbprint kbinfo kbhowto KB898514

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.