question

HEREDEARadu-9592 avatar image
0 Votes"
HEREDEARadu-9592 asked HEREDEARadu-9592 edited

Visio 2019 problem with Characters.CharProps object using a VBS script

Hello, I try to set the property of some characters in a Characters.CharProps object using a VBS script. This script works in previous versions, starting from Visio 2019 (Microsoft® Visio® 2019 MSO (Version 2202 Build 16.0.14931.20118) 32-bit) the behavior is random, at two successive runs different results are obtained. Apparently the property settings for a part of a string (begin end) no longer work.

example:
set ashape4 = appl.ActiveWindow.Page.DrawRectangle(2.225,2.600,5.392,1.200)
ashape4.RowType(5, 0) = 151
set chars = ashape4.Characters
chars.Begin = 0000
chars.End = 0000
chars.Text ="text line1" & Chr(10)
chars.Text ="text line2" & Chr(10)
chars.Begin = 0010
chars.End = 0020
chars.CharProps(1) = 2

For this code the color is set for all the text in the shape not only for line 2. I want to set certain lines with text properties: color, bold, italic..
Do you have any idea if these instructions are no longer supported? I tried macro recording and the behavior is still wrong.
Thanks

office-vba-devoffice-visio-itpro
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, @HEREDEARadu-9592
Since this question is related to Visio Script, I am in charge of Office General. It is recommended that you ask questions in the Office developer community. Thanks for your understanding.


1 Vote 1 ·

0 Answers