Reply
 
Thread Tools Display Modes
  #1   Report Post  
Bill
 
Posts: n/a
Default 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   Report Post  
Jezebel
 
Posts: n/a
Default

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   Report Post  
Bill
 
Posts: n/a
Default

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
sql command word jeo43 Microsoft Word Help 1 January 6th 05 02:58 PM
Command line switches Steve New Users 3 December 28th 04 09:37 AM
Hiding a command button so it doesn't print Mike Microsoft Word Help 1 December 20th 04 07:15 PM
Command line parameter Monika Krug Mailmerge 2 December 17th 04 11:34 AM
confirm SQL command after windows update Chris Mailmerge 1 December 1st 04 11:03 AM


All times are GMT +1. The time now is 03:50 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"