Filehost.ro - gazduire fisiere
Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Nou pe simpatie:
karina22 Profile
Femeie
25 ani
Bucuresti
cauta Barbat
25 - 54 ani
Mrrrr's Forum (VIEW ONLY)ReguliInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides /

[WORD] Field Updating on Saving Any Document / On Button Click

Pagini: 1 Moderat de TRaP, TonyTzu
#1
TRaP
Moderator
Postari: 960
When you click save, all fields will be updated:


Dim WithEvents TheApp As Word.Application

Private Sub Document_Open()
    Set TheApp = ThisDocument.Application
End Sub

Private Sub TheApp_DocumentBeforeSave(ByVal Doc As Document, SaveAsUI As Boolean, Cancel As Boolean)
    Doc.Fields.Update
End Sub


 
   
#2
Mrrrr
AdMiN
Postari: 2388
Make a button and link it to this:


Sub Update_All_Fields()

Dim oStory As Range
For Each oStory In ActiveDocument.StoryRanges
    oStory.Fields.Update
    If oStory.StoryType <> wdMainTextStory Then
        While Not (oStory.NextStoryRange Is Nothing)
            Set oStory = oStory.NextStoryRange
            oStory.Fields.Update
        Wend
    End If
Next oStory
Set oStory = Nothing

End Sub


_______________________________________


 
   
Pagini: 1  
Mergi la