Monday, March 31, 2008

Updating Word Fields (VBA)

Using Word VBA to Update all Field Codes in Word Document


Here is a simple macro that will update all the fields in a Word document

Sub Update_Field()

ActiveWindow.ActivePane.View.Type = wdPrintView
Application.ScreenUpdating = True
Selection.WholeStory
ActiveDocument.Fields.Update

End Sub

2 comments:

  1. Anonymous12:37 AM

    This works fine for normal document fields, but it doesn't update fields in headers/footers.

    ReplyDelete
  2. Look at this... http://msdn.microsoft.com/en-us/library/office/ff196072.aspx

    ReplyDelete

StumbleUpon
Share on Facebook
Related Posts Plugin for WordPress, Blogger...
Download Windows Live Toolbar and personalize your Web experience! Add custom buttons to get the information you care about most.