开发者

MS Word 2003 on open custom property value increment

开发者 https://www.devze.com 2023-03-23 16:27 出处:网络
I have a Word document where I\'ve created a custom property (File > Properties >开发者_StackOverflow社区 Custom)

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
0

精彩评论

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