Here is what I want to achive: I want to use Visio to document a project. I have some Visio text boxes that contain code examples. The code examples have comments in them. The comments are line comments (either the line begins with # or they are places at the end of the line beginning with #
What I need is to have Visio change the comments to another color automatically after I am done with the editing of that shape (a text square).
From what I read this can be achieved with the following:
-use "TheText" event and CALLTHIS("Function-name")
-the "Function-name" procedure should read the text of the shape and search for "#" on each line and turn the text on that line to let's say "grey" till the end of the line.
Could you please confirm me if I am on the right path with this? I am a totally beginner with Visio and VBA. To test the above I used a Macro that should move the shape as soon as the editing is done
Sub Macro()
'Enable diagram services
Dim DiagramServices As Integer
DiagramServices = ActiveDocument.DiagramServicesEnabled
ActiveDocument.DiagramServicesEnabled = visServiceVersion140
ActiveWindow.DeselectAll
ActiveWindow.Select Application.ActiveWindow.Page.Shapes.ItemFromID(88), visSelect
Application.ActiveWindow.Selection.Move 0.5, 0#
'Restore diagram services
ActiveDocument.DiagramServicesEnabled = DiagramServices
End Sub
And "TheText" event cell had this =CALLTHIS("ThisDocument.Macro")
I expected the shape to move to right as soon as I was done with the editing but it did not happen What am I doing wrong?
thanks a lot P