If you comment it out, you'll find that the "Case Is = Null" clause is an invalid use of Null, and that attempting to set the value of the custom propertyĬauses an error if the property doesn't already exist. Your use of the "On Error Resume Next" trap hides a couple of errors in your code.You don't need to qualify ActiveDocument by putting "Application." before it.Also, putting the name in parentheses after the collection name (likeĪn array index) is equivalent to using the. Word allows you to "index" the CustomDocumentProperties collection by the name of the property instead of the number. There's no need for a loop or for knowing the index number.I'll suggest streamlining it in several ways: MyProperty = InputBox(myPrompt, myTitle, myPropertyValue)Ī(j).Value = myProperty MyPrompt = "Current " + myPropertyLower + " is " + myPropertyValue + " please enter new " + myPropertyLower + ": " Sub SetVersion(ByVal command As IRibbonControl) The revised code (and I'd welcome comments for streamlining or improvement): ![]() ![]() I made a few modifications to the code to avoid having to know which index number a document property is.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |