Option Explicit
Dim pTime As Date
Sub Runtimer()
pTime = Now + TimeValue("00:00:06")
Application.OnTime pTime, "myUpDate"
End Sub
Sub myUpDate()
Dim aStory As Range
Application.ScreenUpdating = False
For Each aStory In ActiveDocument.StoryRanges
aStory.Fields.update
Next aStory
Application.ScreenUpdating = True
Runtimer
執行myUpData宏,或者加上下面的部分,直接設為開啟自動執行
Private Sub Document_open()
myUpDate
更新的間隔 TimeValue("00:00:06")
Option Explicit
Dim pTime As Date
Sub Runtimer()
pTime = Now + TimeValue("00:00:06")
Application.OnTime pTime, "myUpDate"
End Sub
Sub myUpDate()
Dim aStory As Range
Application.ScreenUpdating = False
For Each aStory In ActiveDocument.StoryRanges
aStory.Fields.update
Next aStory
Application.ScreenUpdating = True
Runtimer
End Sub
執行myUpData宏,或者加上下面的部分,直接設為開啟自動執行
Private Sub Document_open()
myUpDate
End Sub
更新的間隔 TimeValue("00:00:06")