![change document properties word 2007 change document properties word 2007](https://www.officetooltips.com/thumbnails/tips/338.png)
Value:=myProperty, Type:=msoPropertyTypeStringĪctiveDocument.CustomDocumentProperties(myPropertyLower). Name:=myPropertyLower, LinkToContent:=False, _ I suppose this is to maintain version control, so you can’t go into someone’s computer and change all the intitials on comments to your own.
![change document properties word 2007 change document properties word 2007](https://images.tips.net/S06/Figs/T6028F1.png)
In the left pane you can see different categories, select the Display options and the right pane expands the options available. In order to set these options click on the ‘Office button’ and then select the Word Options. + " please enter new " + myPropertyLower + ": "Ī _ I’ve just tested it in Word 2007 and even if you change the initials with the document open, it will only change the initials from the point at which you make the change, not retrospectively. Display options determine how document content is displayed, on the screen and when printed. of the screen that identifies the author of each change. MyPrompt = "Current " + myPropertyLower + " is " + myPropertyValue _ Tell Word to track changes Lee can edit the document with Track Changes on. If Trim(myPropertyValue) = "" Then myPropertyValue = "empty" If Err.Number 0 Then myPropertyValue = "null" It could be enhanced to make sure the user's entry (myProperty) is a valid value - if you expect a number, make sure you get a number, etc.ĪctiveDocument.CustomDocumentProperties(myPropertyLower)
![change document properties word 2007 change document properties word 2007](https://www.addintools.com/office2010/word/images/shot-word-2010-668x348.gif)
As shown below, use the error trap only where it's necessary, and then turn it off (or modify it to handle only errors that you expect, until you're sure you understand all the things that can happen). 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)
#Change document properties word 2007 code
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. This makes it seem as if there's a commit step of sorts that I'm missing, but shouldn't current_doc.Update on code. We can use CustomDocumentProperties.Add and CustomDocumentProperties.Remove to add and remove the custom properties.
#Change document properties word 2007 software
We cannot add or remove built-in document properties we can just change their values. Use Word 2007s options to change your default document folder by Mary Richardson in Software on May 1, 2007, 12:00 AM PST Each time you save a Word 2007 file, it winds up in the My Documents folder. but without writing the modified CustomDocumentProperties. We have BuiltinDocumentProperties and CustomDocumentProperties to add properties to the word document. My doc_accessor.SaveAndClose() function is working correctly as I modified the path to save to a different location and it did. I have the following method within a DocAccessor class (which serves as an interface for my doc files): void SetInfo(string key, string val) ) Įlsewhere I call: doc_accessor.GetInfo("Number") //returns 5ĭoc_accessor.GetInfo("Number") //returns 6ĭoc_accessor.Open() //it retains the path, so I don't need to respecifyĭoc_accessor.GetInfo("Number") //returns 5 I've been able to read the current value and modify it, but when I save the document the changes to the custom fields are lost. I'm trying to modify some CustomDocumentProperties for a.