Quote:
Originally Posted by Guessed
Your code works on my machine although I did change it to separate the inputbox out
Code:
Sub crosscurve()
Dim str As String
str = InputBox("what is the number of curve do you want to refer?")
Selection.InsertCrossReference ReferenceType:="curve", ReferenceKind:=wdOnlyLabelAndNumber, _
ReferenceItem:=str, InsertAsHyperlink:=True, _
IncludePosition:=False, SeparateNumbers:=False, SeparatorString:=" "
End Sub
The things I would expect would cause it to fail are:
1. The existence of a 'Curve' caption is at the application level. The presence of some curve instances in a document brought from another machine is not enough to tell Word that the type exists. Have you inserted at least one Curve caption on that machine?
2. Is it sensitive to capitalisation?
|
Thank you for your reply. I have found the issue. This code fails because when I insert a caption for my Word curves, sometimes unexpectedly a textbox which is without border and outline and color encompasses the captions. If I solve this problem, I can cross -reference my word curves with this code again.