get value from variable in Word

M

Manish

Hi
I have a string stored in a variable in Word Macro.
How do I retrieve what is in the variable and print it on
the word document ?

Thank you.
 
C

Charles Kenyon

You can put it at the beginning of the document, at the end of the document,
in a particular paragraph, in a custom document property or at a bookmark.
See the web page on inserting text at bookmarks on the VBA faq on the MVP
FAQ site. If you want to use a custom document property, see the pages on
those. Once you have a custom document property the contents are displayed
in your document using a DOCPROPERTY field.
--
Charles Kenyon

Word New User FAQ & Web Directory:
<URL: http://addbalance.com/word/index.htm>

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://addbalance.com/usersguide/index.htm>

See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
D

Doug Robbins - Word MVP

HI Manish

You can use a { DOCVARIABLE "varname" } field

Or .Range.InsertBefore varname.Value

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top