
Signature
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: 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.
Even then, I would load the data stored in the document variables back into
the userform. If it is likely that the data will need to be changed, it is
better to use document variables rather than bookmarks.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>I restart the userform, picking up the previous answers from the document
>where they were inserted. An alternative would be to save document
[quoted text clipped - 11 lines]
>>
>> any thoughts?
natanz - 21 Jul 2005 01:28 GMT
i guess i am not sure what you mean by document variables. can you
show me or direct me to a quick example?
Doug Robbins - 21 Jul 2005 04:58 GMT
Say you have a textbox on the userform with the name of txtFName, then in
the code in the userform that causes the data to be transferred into the
document use
With ActiveDocument
.Variables("varFName").Value = txtFName.Text
.Variables(etc. for the remaining data)
.Fields.Update
End With
In the document you need to have a { DOCVARIABLE varFName } field. The
.Fields.Update statement will cause it to display the data that was entered
into the txtFName textbox.
To reload the data into the userform, in the Initialise event, use
txtFName = ActiveDocument.Variables(varFName).Value

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
> Even then, I would load the data stored in the document variables back
> into the userform. If it is likely that the data will need to be changed,
[quoted text clipped - 15 lines]
>>>
>>> any thoughts?
Charles Kenyon - 21 Jul 2005 13:49 GMT
I agree, I do repopulate the userform with existing data. Making the user
reenter everything to make a few changes makes for very unhappy users. My
primary userform is set to glean data from other files (at styles) and
insert the data into the new file at the same styles so I use the same code
to pull it back out. Otherwise, I use document variables and fields.

Signature
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: 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.
> Even then, I would load the data stored in the document variables back
> into the userform. If it is likely that the data will need to be changed,
[quoted text clipped - 15 lines]
>>>
>>> any thoughts?