Печать комментариев в Visio 2016

683
GuruLong

Я не могу понять, как напечатать комментарии, которые я включил в мою диаграмму Visio. Я нашел макрос, который должен был работать в Visio 2013. Он действительно создал объект с заголовками заголовка, Reviewer, Date и Comment. Тем не менее, не было никакого текста.
Я предполагаю, что макрос в основном правильный, но отсутствует что-то, что изменилось с Visio 2013 на Visio 2016. Кто-нибудь может помочь?

Спасибо

1

1 ответ на вопрос

0
Michael Cameron

Прошло некоторое время с тех пор, как об этом спросили, но я столкнулся с проблемой сегодня, поэтому собрал быстрый и грязный скрипт, который создает прямоугольник слева от текущей страницы (аналогично другим решениям, которые я видел), а затем прикрепляет все комментарии от активная страница для нового объекта. Я думаю, что проблема в том, что модель для комментариев в Visio 2016 полностью отличается от того, что было раньше.

Если это поможет кому-нибудь, не стесняйтесь использовать его, пожалуйста, напишите мне, если это поможет вам

Спасибо,

Майкл
techiestuff@dreich.net

'This is in no way comprehensive and is not intended to be production quality 'It does what it does 'techiestuff@dreich.net July 2018  Public Sub ShowComments() Dim oPage As Visio.Page Dim oShape As Visio.Shape Dim oComments As Visio.Comment Dim sText As String  Set oPage = Visio.ActivePage sText = "Initials" & vbTab & "Date" & vbTab & "Comment"  'Loop through comments creating a string containing them all For Each oComment In oPage.Comments sText = sText & vbCrLf & oComment.AuthorInitials sText = sText & vbTab & oComment.EditDate sText = sText & vbTab & oComment.Text Next oComment  'Create a new shape with all the comments attached as visible text 'Save the current value of autosize, create a rectangle using autosize=0 then restore autosize to its orignal value 'The rectangle is created as the same size as the current page but immediately to the left of it Dim iAutoSize As Integer iAutoSize = oPage.AutoSize oPage.AutoSize = 0 Set oShape = oPage.DrawRectangle(-oPage.PageSheet.Cells("PageWidth").ResultIU, 0, 0, oPage.PageSheet.Cells("PageHeight").ResultIU) oPage.AutoSize = iAutoSize 'Set the text alignment for the rectangle to Top/Left oShape.Cells("Para.HorzAlign").Formula = "0" oShape.Cells("VerticalAlign").Formula = "0" 'Give it a name and add the comments to it oShape.Name = "Review Comments" oShape.Text = sText End Sub 

Похожие вопросы