MS Word 2003 on open custom property value increment
I have a Word document where I've created a custom property (File > Properties >开发者_StackOverflow社区 Custom)
Name: autoInc
Type: Number
Value: 999
I want to know how to auto increment the value by 1 and override the current value every time this file is being saved.
I would use the Document_Save
Event, and in it increment the value. A great link to doing that is here (and a little too complicated to post an excerpt).
Though if you wanted to just do it simply, I think this will work:
ActiveDocument.CustomDocumentProperties("autoInc").Value =
ActiveDocument.CustomDocumentProperties("autoInc").Value + 1
精彩评论