Visio Guy

Visio Discussions => General Visio => Topic started by: CookieEater200 on April 26, 2022, 08:29:28 PM

Title: insert user defined field
Post by: CookieEater200 on April 26, 2022, 08:29:28 PM
Hello,

I have some text that appears in a couple places of my visio document. I like to change it at once place and have it populated at all the other places it is supposed to appear. How do I do that?  :-\ I know about the page background, but it is not suitable for me.

When I go to Insert->Field->Document info, there are a few names of fields I could use such as "subject" and "title". Where do I define those?

There is also Insert->Filed->User defined cells. I googled many times and can't find any information.

Thanks.
  :D
Title: Re: insert user defined field
Post by: Surrogate on April 27, 2022, 05:24:22 AM
If you want use User-defined cells, your shape must have cells in this section, as first.
You must use ShapeSheet functions (https://docs.microsoft.com/en-us/office/client-developer/visio/functions-visio-shapesheet-reference) for get desired values in user-defined cells. ShapeSheet functions is similar as Excel's functions.
Title: Re: insert user defined field
Post by: vojo on April 27, 2022, 01:34:02 PM
to get to shape sheet, got to run in developer mode

file ==> options ==> advanced options ==> <bottom of that menu> ==> enable developer mode
Title: Re: insert user defined field
Post by: wapperdude on April 27, 2022, 06:33:08 PM
What's wrong with using background page?
Title: Re: insert user defined field
Post by: CookieEater200 on April 28, 2022, 05:56:23 PM
>What's wrong with using background page?
The background page works when I have the same information on the same location on many pages. I do use that. :)

The usage case the background page does not cover easily is the case where I have a piece of information that appears several times on one page.
For example, I have a several cartridges on a page with the date: at the top of the sheet, at the bottom and a box with a few locations of names of people with the date next to that. I like to change that just one time. I don't want to take automatically today's date because I might open the document ago just to look at it and not change the date.
Title: Re: insert user defined field
Post by: CookieEater200 on April 28, 2022, 06:08:46 PM
>If you want use User-defined cells, your shape must have cells in this section, as first.
I enabled developer. I got to the Show Shape sheet, I see that for the document shape sheet and the page shape sheet, I get a section with table titled "user-defined cells". I can insert a new row. I can't put anything besides numbers in the value cell.

In the insert->Field at the user-defined cells, I don't see anything. Was I supposed to use the shape sheet for the document or page? Or do something completely different ?
Title: Re: insert user defined field
Post by: wapperdude on April 28, 2022, 10:39:26 PM
QuoteI can't put anything besides numbers in the value cell.
.
Wrap your text string in dbl quotes.

QuoteWas I supposed to use the shape sheet for the document or page?
The doc shapesheet is more useful for multiple pages where the same text is used.
If the text is unique to the page, then the page shapesheet might be a better option.

QuoteIn the insert->Field at the user-defined cells, I don't see anything.
Only User cells that have an entry will be displayed.

To get a more complete grasp of the shapesheet, check out this link and its additional links:  https://docs.microsoft.com/en-us/office/client-developer/visio/open-the-shapesheet-for-a-shape-page-or-document (https://docs.microsoft.com/en-us/office/client-developer/visio/open-the-shapesheet-for-a-shape-page-or-document)

Title: Re: insert user defined field
Post by: CookieEater200 on April 29, 2022, 08:28:52 PM
Thanks for your response @wapperdude.

QuoteOnly User cells that have an entry will be displayed.
I'm sorry. I'm still stuck.  :'(

In the shapesheet for the page, I see:

Document Properties
Preview quality: 0,  OutputFormat:0 PreviewScope:0
LockPreview: FALSE, AddMarkup: No Formula, ViewMarkup: No Formula
DocLangID: 1033, DocLockReplace: No Formula, NoCoath: No Formula
DocLockDuplicatePage: No Formula

User-defined cells    Value   Prompt
User.msvConvertTherme: No Formula,    No Formula
User.msvNoAutoConnect:1, No Formula
User.CookieEater200ReleaseDate: "2022/04/29"  ""


I click Insert-> Text Box.
Next, inside the text box, I click Insert->Field.
I click the User-defined cells, and there is nothing under Field name.

What am I missing?
Title: Re: insert user defined field
Post by: wapperdude on April 29, 2022, 10:43:18 PM
In the User Defined section of shape sheet you need to add a row.  Give the row a name if you like, e.g., Nice.  Then, enter something in the vale cell, e.g., 16 or "Sixteen". Close the shapesheet.

Select a shape on the page.  Do the Insert > Field.  This is the not so obvious part...select Custom formula.  For the above example, enter:  ThePage!User.Nice.  Then, hit OK or whatever the prompt is.  The shape should display the value you had set.

Title: Re: insert user defined field
Post by: CookieEater200 on May 02, 2022, 01:16:13 PM
Works great! Thanks!