Working with Shape Obj values

Started by JasonB_SE, October 29, 2022, 03:52:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JasonB_SE

I'm working on a visio template that hopefully will be circuilated amongst my team of fellow SE's to attempt to standardize and put some company branding to our customer viewed documents.

In order to sell it internally, i'm trying to add some automation to certain values contained on the template

There are 4 text shapes involved here.
myModDate = Last modified date (this is an inserted object field)
myProjectName = the "Title" of the visio document
myVersion = manually updated Version number (starts at 1.0 and is manually changed at the moment - i'll automate that as soon as I can get past my roadblock...)
myFilename = a concatenation of the values from the obove 3 objects.

The one I'm having trouble with is getting the actual date string from myModDate object.  The other two are returning just as expected.


activepage.shapes("myFilename").text = activepage.shapes("myProjectName").text & "_" & activepage.shapes("myVersion").text & activeepage.shapes("myModDate").text


what it populates in place of the actual date from the page is a little square with OBJ in it. 

I've exercised much google=Fu to try to figure this out and I think I need to be using the SET function to a new dim'd variable  myModDateText (as string) using the target from above but that's not working either. 

What am I missing?

Thanks in advance!!!

UPDATE - I found it.  using .characters instead of .text, it now returns the expected date data from the object.  Off to tackle the next problem, but I would like to understand better the relationship Differences between text and characters.

wapperdude

Is there a reason for using 4 shapes?  This could be done in a single shape.  The modified data is document level data and does not need a "holding" shape.  Likewise, for the document title once it's been saved.  The version can be user entered and stored at some convenient place.

How is the file name used.  You must be careful with it's syntax... especially the date element.

Just curious.
Visio 2019 Pro