michaelbr55
Programmer
- Oct 8, 2002
- 70
I have writen a macro to add custom properties to a document, this worked well in the first instance, but now, after changing some other parts of the whole program, this macros generates a "Invalid procedure call or argument (Error 5)"
every time it is run. If I debug it, when I hold the cursor over the "Name" in "Add Name" it returns "Microsoft Word", I don't know if this has anything to do with the problem or not. below is the part of the macro that is giving me the error.
refno = 0
refno = ActiveDocument.CustomDocumentProperties("No of References"
.Value
refno = refno + 1
ActiveDocument.CustomDocumentProperties.Add _
Name:="References" & refno, LinkToContent:=False, Value:=TextEntry(X), _
Type:=msoPropertyTypeString
If refno > 0 Then
ActiveDocument.CustomDocumentProperties("No of References"
.Delete
ActiveDocument.CustomDocumentProperties.Add _
Name:="No of References", LinkToContent:=False, Value:=refno, _
Type:=msoPropertyTypeString
End If
Can anyone help Please!!!!!!!!!!
every time it is run. If I debug it, when I hold the cursor over the "Name" in "Add Name" it returns "Microsoft Word", I don't know if this has anything to do with the problem or not. below is the part of the macro that is giving me the error.
refno = 0
refno = ActiveDocument.CustomDocumentProperties("No of References"
refno = refno + 1
ActiveDocument.CustomDocumentProperties.Add _
Name:="References" & refno, LinkToContent:=False, Value:=TextEntry(X), _
Type:=msoPropertyTypeString
If refno > 0 Then
ActiveDocument.CustomDocumentProperties("No of References"
ActiveDocument.CustomDocumentProperties.Add _
Name:="No of References", LinkToContent:=False, Value:=refno, _
Type:=msoPropertyTypeString
End If
Can anyone help Please!!!!!!!!!!