开发者

Updating Word Template with bookmarks

开发者 https://www.devze.com 2022-12-09 00:46 出处:网络
I have Template made in Word 2003 which is sometimes updated (add开发者_如何转开发ing text, bookmarks, formfields ...) and its located on intranet and has the same name all the time (for example \"Mas

I have Template made in Word 2003 which is sometimes updated (add开发者_如何转开发ing 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
0

精彩评论

暂无评论...
验证码 换一张
取 消