Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-18-2014, 11:48 AM
Phil H Phil H is offline Go To Index Macro Windows XP Go To Index Macro Office 2003
Advanced Beginner
Go To Index Macro
 
Join Date: Jun 2010
Posts: 81
Phil H is on a distinguished road
Default Go To Index Macro


I need a macro that I can attach to a button on the QAT that sends me to the index. Is there such a macro out there somewhere?
Reply With Quote
  #2  
Old 11-18-2014, 11:57 AM
gmaxey gmaxey is offline Go To Index Macro Windows 7 32bit Go To Index Macro Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,428
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Something like this perhaps:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oFld As Word.Field
  For Each oFld In ActiveDocument.Range.Fields
    If oFld.Type = wdFieldIndex Then
      oFld.Select
    End If
    Exit For
  Next oFld
    
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 11-18-2014, 12:26 PM
Phil H Phil H is offline Go To Index Macro Windows XP Go To Index Macro Office 2003
Advanced Beginner
Go To Index Macro
 
Join Date: Jun 2010
Posts: 81
Phil H is on a distinguished road
Default

Greg, Thanks for your reply. This didn't work. What I need is - wherever I am in a document, if I click the button in the QAT, it takes me to the index at the end of the document. I set this up and it does nothing when I click the macro icon.
Reply With Quote
  #4  
Old 11-18-2014, 12:34 PM
gmaxey gmaxey is offline Go To Index Macro Windows 7 32bit Go To Index Macro Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,428
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Phil,

I had the Exit For in the wrong place. Sorry:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oFld As Word.Field
  For Each oFld In ActiveDocument.Range.Fields
    If oFld.Type = wdFieldIndex Then
      oFld.Select
      Exit For
    End If
    
  Next oFld
    
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #5  
Old 11-18-2014, 07:54 PM
fumei fumei is offline Go To Index Macro Windows 7 64bit Go To Index Macro Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

Or just a bookmark. That is kind of what they are good for. That way you are not iterating through possible fields.
Reply With Quote
Reply

Tags
gotoindex macro, index, indexing in word



Similar Threads
Thread Thread Starter Forum Replies Last Post
Go To Index Macro Create index gtpt Word 1 03-07-2014 07:34 PM
Need help with Index formula gbaker Excel 7 02-07-2014 06:34 AM
Go To Index Macro Formatting a second index Lebber Word 3 08-05-2013 02:13 AM
Adding an Index savo Word 1 04-17-2013 06:16 PM
Go To Index Macro Index switches cksm4 Word VBA 2 02-03-2011 07:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:30 AM.


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