Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub addCrossRefernce()
- Dim n As String
- On Error GoTo noReference
- tryAgain:
- n = InputBox("enter number of equation to refer!")
- If n <> "" Then
- Selection.InsertCrossReference ReferenceType:="Equation", ReferenceKind:= _
- wdOnlyLabelAndNumber, ReferenceItem:=n, InsertAsHyperlink:=True, _
- IncludePosition:=False, SeparateNumbers:=False, SeparatorString:=" "
- End If
- Exit Sub
- noReference:
- Err.Clear
- If MsgBox("There is no equation " & n & " in the document, do you want to enter another number?", _
- vbYesNo) = vbYes Then
- GoTo tryAgain
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement