View Single Post
 
Old 01-05-2016, 06:29 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could use code like in the document's 'ThisDocument' code module:
Code:
Private Sub CommandButton1_Click()
Call GotoText("Initial LiDAR Capture")
End Sub
 
Private Sub CommandButton3_Click()
Call GotoText("Initial Work")
End Sub
 
Sub GotoText(StrTxt As String)
Application.ScreenUpdating = False
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = StrTxt
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = True
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    .Execute
  End With
  If .Find.Found = True Then .Select
End With
Application.ScreenUpdating = True
End Sub
Note that your document will have to be saved in the docm format for this to work once it's been closed & re-opened; otherwise you'll lose the code.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote