UserName Field - Update Automatically

P

PumaMan

I have the "UserName" field inserted on protected letters, which i need
updated automatically (On Open preferrably). What is the best way to do
this? If I have to use VBA, that's fine. I just have no clue on how to do it
with this field type.

Thanks!
Elbio
 
P

PumaMan

Ah, I got it to work with a Macro. There is no non-programmatic way is there?
I don't want users to have to "Enable Macros" each time they open the
letter...

Sub UpdateAllFields()
Dim oStory As Range
Dim oField As Field
For Each oStory In ActiveDocument.StoryRanges
For Each oField In oStory.Fields
oField.Update
Next oField
Next oStory
End Sub
 
D

Doug Robbins - Word MVP on news.microsoft.com

It sounds like the "letter" should be saved as a template in the templates
folder and that the macro should be named AutoNew(). It will then run when
the user selects New from the File menu and then selects the template as the
basis of the document that they want to create. As the templates folder in
which the template is saved is considered by Word to be a trusted location,
the user will not have to enable the macros to run.

--
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, originally posted via msnews.microsoft.com
 

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