A Microsoft Word forum. Microsoft Office Word Forum - WordBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Microsoft Office Word Forum - WordBanter forum » Microsoft Word Newsgroups » Microsoft Word Help
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Using DocVariable

Thread Tools Display Modes
Old July 5th 19, 04:02 AM
fuzmic fuzmic is offline
Junior Member
First recorded activity by WordBanter: Jul 2019
Posts: 0
Default Using DocVariable

Hi gurus

I am still using very old Word 2003 and want to explore the use of Variables.

I have get into the Tools .. Visual Basic Editor to type in the Document module

Sub GetSetDocVars()
Dim fName As String
fName = "Jeff Smith"
' Set contents of variable "fName" in a document using a document
' variable called "FullName."
ActiveDocument.Variables.Add Name:="FullName", Value:=fName
End Sub

Then at the insert Field DocVarible
I type in the variable FullName

The following {} field code appear

but on Alt-F9, nothing is displayed

This is my first attempt at using variables in Word even though i have done some VB6 and VBA coding

Please guide me to get in. Thanks peers.

Last edited by fuzmic : July 5th 19 at 08:21 AM.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with setting the value of DOCVARIABLE Amanda Allen Microsoft Word Help 0 September 20th 18 05:09 PM
DocVariable Paul Mailmerge 2 December 1st 09 07:55 PM
docvariable, template (.dot) Paul Mailmerge 2 October 7th 09 08:56 PM
Help with FIELD CODES: DOCVARIABLE!!! Wendy D Microsoft Word Help 2 August 16th 05 08:32 PM
Cannot printing DocVariable Field lubo Microsoft Word Help 1 April 9th 05 07:00 AM

All times are GMT +1. The time now is 12:36 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2004-2019 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.