Word macro to jump to a random page
Sub RandomPage()
'
' RandomPage Macro
' Macro recorded 6/9/2004 by Jonathan Aquino
'
Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:=(Int (ActiveDocument .Content .Information(wdActiveEndAdjustedPageNumber) * Rnd() + 1))
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
End Sub
'
' RandomPage Macro
' Macro recorded 6/9/2004 by Jonathan Aquino
'
Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:=(Int (ActiveDocument .Content .Information(wdActiveEndAdjustedPageNumber) * Rnd() + 1))
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
End Sub
1 Comments:
Works great. Just be sure to remove the spaces in:
ActiveDocument.Content.Information
By Jon, at 4/09/2007 12:23 p.m.
Post a Comment
<< Home