Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / September 2004

Tip: Looking for answers? Try searching our database.

Auto Update DOCPROPERTY

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Colin Steadman - 15 Sep 2004 11:18 GMT
If I change a DOCPROPERTY value, what is the fastest way to update all
DOCPROPERTY fields in the document?  I am using Edit | Select All and
F9 to update the DOCPROPERTY values.

Is there a better/faster way?

TIA,

Colin
Greg - 15 Sep 2004 15:18 GMT
Collin,

I use a pair of macros in my document template.  Here is
an example.  All you really need is the last
line "ActiveDocument.Fields.Update":

Sub AutoNew()
   Dim EmpName As String
   Dim BadgeNum As String
       EmpName = InputBox("Enter employee
name", "Employee Name", "John Q. Sample")
       BadgeNum = InputBox("Enter badge number", "Badge
Number", "0000")
       ActiveDocument.CustomDocumentProperties("Employee
Name").Value = EmpName
       ActiveDocument.CustomDocumentProperties("Badge
Number").Value = BadgeNum
       ActiveDocument.Fields.Update
End Sub

Sub AutoOpen()

Dim Update As VbMsgBoxResult
Dim PolicyNum As String
Dim ClientName As String
On Error GoTo ExitSub
Update = MsgBox("Update Document Information?", vbYesNo)
If Update = vbYes Then
    EmpName = InputBox("Enter employee name", "Employee
Name", "John Q. Sample")
    BadgeNum = InputBox("Enter badge number", "Badge
Number", "0000")
    ActiveDocument.CustomDocumentProperties("Employee
Name").Value = EmpName
    ActiveDocument.CustomDocumentProperties("Badge
Number").Value = BadgeNum
    ActiveDocument.Fields.Update
End If
ExitSub:
End Sub

>-----Original Message-----
>If I change a DOCPROPERTY value, what is the fastest way to update all
[quoted text clipped - 7 lines]
>Colin
>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.