Jon Aquino's Mental Garden

Engineering beautiful software jon aquino labs | personal blog

Wednesday, June 09, 2004

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

1 Comments:

Post a Comment

<< Home