简体   繁体   中英

Updating Word Template with bookmarks

I have Template made in Word 2003 which is sometimes updated (adding text, bookmarks, formfields ...) and its located on intranet and has the same name all the time (for example "Master_layout.dot"). When somebody create the document from this template (for example version 3) and then I will make version 4 then the document made from version 3 is not updated and it does not include the changes which I made. I would like to use some VBA script which will check if the Template has the same content (formfields, bookmarks, text...) like the document and if not then add the text, formfield and so on into the document.

Thanks for any help or tip.

Rather than checking that the content is the same, you might want to consider using a custom property on the template to store the version number. Then you can just check the version.

Sub CheckVersion()

    If ActiveDocument.CustomDocumentProperties("VersionNum").Value <> 4 Then
        'do stuff'
    End If

End Sub

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM