Log in
x
or
x
x
Register
x

or

Kutools for Excel 21.00 HOT

300+ Powerful Features You Must Have in Excel

Kutools-for-Excel

Kutools for Excel is a powerful add-in that frees you from performing time-consuming operations in Excel, such as combine sheets quickly, merge cells without losing data, paste to only visible cells, count cells by color and so on. 300+ powerful features / functions for Excel 2019, 2016, 2013, 2010, 2007 or Office 365!

Read More Download Buy now

Office Tab 14.00HOT

Adding Tabbed Interface for Office

Office Tab

It enables tabbed browsing, editing, and managing of Microsoft Office applications. You can open multiple documents / files in a single tabbed window, such as using the browser IE 8/9/10, Firefox, and Google Chrome. It's compatible with Office 2019, 2016, 2013, 2010, 2007, 2003 or Office 365. Demo

Read More Download Buy now

Kutools for Outlook 12.00NEW

100+ Powerful Features for Outlook

Kutools-for-Outlook

Kutools for Outlook is a powerful add-in that frees you from time-consuming operations which majority of Outlook users has to perform daily! It can save your time from using Microsoft Outlook 2019, 2016, 2013, 2010 or Office 365!

Read More Download Buy now

Kutools for Word  9.00NEW

100+ Powerful Features for Word

Kutools-for-Word

Kutools for Word is a powerful add-in that frees you from time-consuming operations which majority of Word users have to perform daily! It can save your time from using Microsoft Word / Office 2019, 2016, 2013, 2010, 2007, 2003 or Office 365!

Read More Download Buy now

Classic Menu for Office

Bringing Back Your Familiar Menus

Restores the old look and menus of Office 2003 to Microsoft Office 2019, 2016, 2013, 2010, 2007 or Office 365. Don’t lose time in finding commands on the new Ribbon. Easy to deploy to all computers in enterprises and organizations.

Read More Download Buy now

How to auto update field codes when reopen document in Word?

In Word document, we can insert the document name by using the fields, but if the document has been renamed, the file name filed cannot be updated automatically. In this tutorial, I introduce the way to auto update all field codes after reopening the document in Word.

Auto update field codes when reopen in Word


Auto update field codes when reopen in Word

In Word, there is no built-in function can update the inserted fields, except the VBA code.

1. Press Alt + F11 keys to enable Microsoft Visual Basic for Applications window, double click ThisDocument in the left pane to open the ThisDocument (Code) window.

2. Copy and paste below code to the ThisDocument (Code) window.

VBA: Refresh field codes when reopen the document

Sub AutoOpen()
'UpdatebyExtendoffice20180830
    Dim xRange As Range
    Dim xFiled As Field
    For Each xRange In ActiveDocument.StoryRanges
        For Each xFiled In xRange.Fields
            xFiled.Update
        Next
    Next
End Sub

doc auto update fields when open 1

3. Click doc saveto save the code in Microsoft Visual Basic for Applications window, a Microsoft Word dialog pops out, click No to go to the Save As dialog.
doc auto update fields when open 2

4. In the Save As dialog box, select a folder to save the document, name it as you need, select Word Macro-enabled Document from the Save as type drop-down, and then click the Save button. See screenshot:
doc auto update fields when open 3

From now on, every time you open the Macro-enable document, all field codes will be updated automatically.
doc auto update fields when open 4

Note: Make sure the Enable all macros (not recommended; potentially dangerous code can run) option is checked in Trust Center dialog (Click File > Options > Trust Center > Macro Settings).
doc auto update fields when open 5

Tabbed browsing & editing multiple Word documents/Excel workbooks as Firefox, Chrome, Internet Explore 10!

You may be familiar to view multiple webpages in Firefox/Chrome/IE, and switch between them by clicking corresponding tabs easily. Here, Office Tab supports similar processing, which allow you to browse multiple Word documents or Excel workbooks in one Word window or Excel window, and easily switch between them by clicking their tabs.
Click for free trial of Office Tab!

Browse multiple word documents in one window as Firefox


Recommended Word Productivity Tools

 

Kutools For Word - More Than 100 Advanced Features For Word, Save Your 50% Time

  • Complicated and repeated operations can be done one-time processing in seconds.
  • Insert multiple images across folders into Word document at once.
  • Merge and combine multiple Word files across folders into one with your desired order.
  • Split the current document into separate documents according to heading, section break or other criteria.
  • Convert files between Doc and Docx, Docx and PDF, collection of tools for common conversions and selection, and so on...
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Feature Tutorials