E
Eric F.
I need to add multiple custom properties to a many documents in multiple
folders. The folders, property names, and values will vary so I want to have
some flexibility to change these values easily, say with a userform, rather
than hard code these. I haven't set up the folder picker part of the code yet
but think I will be OK there as I have several examples from here and the
Word MVP site and have already written some code similar to what I think I
will need.
My immediate problem is setting up code for a userform to enter the custom
document property names and values in textboxes. The basic code for a simple
userform with 1 textbox for the property name and a second for the property
value is something like this:
If CustPropName1.Text <> "" Then
With oDoc.CustomDocumentProperties
.Add Name:=CustPropName1.Text, _
LinkToContent:=False, _
Type:=msoPropertyTypeString, _
Value:=CustPropVal1.Text
End With
End If
I know I can repeat this code for as many pairs of text boxes as I want. It
seems I should be able to use a loop to handle any number of pairs; but I
can't make anything work. Any suggestions? Thanks.
folders. The folders, property names, and values will vary so I want to have
some flexibility to change these values easily, say with a userform, rather
than hard code these. I haven't set up the folder picker part of the code yet
but think I will be OK there as I have several examples from here and the
Word MVP site and have already written some code similar to what I think I
will need.
My immediate problem is setting up code for a userform to enter the custom
document property names and values in textboxes. The basic code for a simple
userform with 1 textbox for the property name and a second for the property
value is something like this:
If CustPropName1.Text <> "" Then
With oDoc.CustomDocumentProperties
.Add Name:=CustPropName1.Text, _
LinkToContent:=False, _
Type:=msoPropertyTypeString, _
Value:=CustPropVal1.Text
End With
End If
I know I can repeat this code for as many pairs of text boxes as I want. It
seems I should be able to use a loop to handle any number of pairs; but I
can't make anything work. Any suggestions? Thanks.