I am not using VBA. I need this to work for any office document and from a separate windows app. The idea is to select 30 word documents and add the custom properties to all the files. I have been most successful with the following code..
Dim oWordApp As New Word.Application(
Dim oWordDoc As New Word.Document(
Dim oProps As Objec
oWordDoc = oWordApp.Documents.Open("c:\test.doc", , , , , , , , , , , False
oProps = oWordDoc.ActiveWindow.Document.CustomDocumentPropertie
oProps.Add("Test", False, msoPropertyTypeString, "Test"
'MsgBox(oWordDoc.Name & " is opened"
oWordDoc.Save(
oWordDoc.ActiveWindow.Close(
The add method does not work properly. I don't know what value to assign to the msoPropertyString constant.