How to print comments that are inserted by reviewers when you use the Track Markup feature in Visio 2010, in Visio 2007, or in Visio 2003

Support for Office 2003 has ended

Microsoft ended support for Office 2003 on April 8, 2014. This change has affected your software updates and security options. Learn what this means for you and how to stay protected.

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 Visio 2010, in Microsoft Office Visio 2007, or in Microsoft Office Visio 2003.
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.
  1. Create the macro. To do this, follow these steps:
    1. Start Visio, and then open your drawing.
    2. Press ALT+F11 to start Microsoft Visual Basic Editor.
    3. On the Insert menu, click Module.
    4. Copy the following code, and then paste the code in the FileName - ModuleNumber (Code) window:
      Public Sub GetComments()Dim pagMarkup As Visio.PageDim pag As Visio.PageDim shp As Visio.ShapeDim sText As StringDim iRow As IntegerSet pag = Visio.ActivePagesText = "Reviewer" & vbTab & "Date" & vbTab & "Comment"If pag.PageSheet.SectionExists(Visio.visSectionAnnotation, Visio.visExistsAnywhere) ThenFor iRow = 0 To pag.PageSheet.RowCount(Visio.visSectionAnnotation) - 1sText = 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).ResultIUsText = 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 iRowEnd IfFor Each pagMarkup In pag.Document.PagesIf pagMarkup.Type = visTypeMarkup ThenIf pagMarkup.OriginalPage = pag ThenIf pagMarkup.PageSheet.SectionExists(Visio.visSectionAnnotation, Visio.visExistsAnywhere) ThensText = sText & vbCrLfsText = sText & vbCrLf & pag.Document.DocumentSheet.CellsSRC(Visio.visSectionReviewer, pagMarkup.ReviewerID - 1, Visio.visReviewerName).ResultStr("")For iRow = 0 To pagMarkup.PageSheet.RowCount(Visio.visSectionAnnotation) - 1sText = 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).ResultIUsText = 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 iRowEnd IfEnd IfEnd IfNext pagMarkupDim iAutoSize as Integer 'newiAutoSize = pag.AutoSize 'newpag.AutoSize = 0 'newSet shp = pag.DrawRectangle(-pag.PageSheet.Cells("PageWidth").ResultIU, 0, 0, pag.PageSheet.Cells("PageHeight").ResultIU)pag.AutoSize = iAutoSize 'newshp.AddSection visSectionUser 'newshp.AddNamedRow visSectionUser, "msvNoAutoSize", visTagDefault 'newshp.CellsU("User.msvNoAutoSize").FormulaU = 1 'newshp.Cells("Para.HorzAlign").Formula = "0"shp.Cells("VerticalAlign").Formula = "0"shp.Name = "Reviewers Comments"shp.Text = sTextEnd Sub
    5. Press CTRL+S to save the drawing.
    6. On the File menu, click Close and Return to Visio.
  2. Run the macro. To do this, follow these steps:
    1. On the Tools menu, point to Macros, and then click Macros.
    2. 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.
vso2007 vso

Article ID: 898514 - Last Review: 08/26/2011 15:50:00 - Revision: 5.2

Microsoft Visio Premium 2010, Microsoft Visio Standard 2010, Microsoft Visio Professional 2010, Microsoft Office Visio Professional 2007, Microsoft Office Visio Standard 2007, Microsoft Office Visio Professional 2003

  • kbdisplay kbprint kbinfo kbhowto KB898514