开发者

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
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜