Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 04-18-2022, 07:19 PM
Guessed's Avatar
Guessed Guessed is offline How to Write a macro to automate Cross Refrenceing? Windows 10 How to Write a macro to automate Cross Refrenceing? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 

Tags
cross referencing



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Write a macro to automate Cross Refrenceing? Can I write a macro in which I Use the Mouse? Rayroshi Word VBA 4 09-06-2020 06:28 PM
How to write macro yoyo4 Excel Programming 1 11-19-2017 11:43 PM
Macro: automate a contract? 1questionman Word VBA 3 10-17-2017 08:29 PM
Macro to automate changes to slide Mearsy PowerPoint 0 08-18-2015 03:29 AM
How to Write a macro to automate Cross Refrenceing? Can I automate or make a macro for this? mkoenig Word VBA 1 01-31-2010 02:47 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:29 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft