Home |
Search |
Today's Posts |
|
#1
|
|||
|
|||
Using the "SET" command
I have a document that I'd like to add a
"SET" command to initialize what amounts to a document variable. I.e., I set the variable and then use the variable to insert its value amongst the text of the document. Example: {SET DOT "revise this string when date becomes available"} blah blah blah {DOT} blah blah blah blah {DOT} blah blah blah blah blah blah {DOT} I coded the DOT variable name as you see above but the substitutions are not occurring. Do I misunderstand the use of field codes? Thanks, Bill |
#2
|
|||
|
|||
The SET command is a way to define a bookmark. To refer to the contents of a
bookmark, use REF fields ... so in place of your {DOT} instructions you should have {REF DOT}. However, you might find it easier to use a document property instead: define the 'variable' on File Properties Custom, then use a docproperty field { DocProperty DOT } to display the value. This has three advantages: 1) it's a little easier to see what the value is set to, 2) there's no danger of accidentally deleting the instruction that sets the value -- SET instructions are necessarily invisible when field codes are hidden, so it's easy to forget that they are there, and 3) document properties are easier to read and set programmatically. "Bill" wrote in message ink.net... I have a document that I'd like to add a "SET" command to initialize what amounts to a document variable. I.e., I set the variable and then use the variable to insert its value amongst the text of the document. Example: {SET DOT "revise this string when date becomes available"} blah blah blah {DOT} blah blah blah blah {DOT} blah blah blah blah blah blah {DOT} I coded the DOT variable name as you see above but the substitutions are not occurring. Do I misunderstand the use of field codes? Thanks, Bill |
#3
|
|||
|
|||
Jezebel,
I tried your suggestion with the document properties by defining the variable name fldDOT and setting its value to a string. Then, I coded {DocProperty fldDOT} in my document where I wanted the string to appear but the substitution did not occur, as one would expect with bookmark and cross-reference. Did I not understand your instructions? Thanks, Bill "Jezebel" wrote in message ... The SET command is a way to define a bookmark. To refer to the contents of a bookmark, use REF fields ... so in place of your {DOT} instructions you should have {REF DOT}. However, you might find it easier to use a document property instead: define the 'variable' on File Properties Custom, then use a docproperty field { DocProperty DOT } to display the value. This has three advantages: 1) it's a little easier to see what the value is set to, 2) there's no danger of accidentally deleting the instruction that sets the value -- SET instructions are necessarily invisible when field codes are hidden, so it's easy to forget that they are there, and 3) document properties are easier to read and set programmatically. "Bill" wrote in message ink.net... I have a document that I'd like to add a "SET" command to initialize what amounts to a document variable. I.e., I set the variable and then use the variable to insert its value amongst the text of the document. Example: {SET DOT "revise this string when date becomes available"} blah blah blah {DOT} blah blah blah blah {DOT} blah blah blah blah blah blah {DOT} I coded the DOT variable name as you see above but the substitutions are not occurring. Do I misunderstand the use of field codes? Thanks, Bill |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
sql command word | Microsoft Word Help | |||
Command line switches | New Users | |||
Hiding a command button so it doesn't print | Microsoft Word Help | |||
Command line parameter | Mailmerge | |||
confirm SQL command after windows update | Mailmerge |