B
Bertrand
Hi,
I need to "clone" the current page a number of times. I do this with a
Selection object by calling Copy and then Paste a number of times which works
fine. My problem is how to select the contents of the current page?
I have tried to select the current page (se sample below) by using
Selection.GoTo but this dos'ent work if I am on the first/last page because
the selection does not move. Then how do I do it?
Any help would be appreciated
Bertrand
' Trick to go to the top of the current page
Selection.GoTo(What:=wdGoToPage, Which:=wdGoToPrevious, Name:="").Select
Selection.GoTo(What:=wdGoToPage, Which:=wdGoToNext, Name:="").Select
' Enable selection mode
Selection.ExtendMode = True
' Go to the next page
Selection.GoTo(What:=wdGoToPage, Which:=wdGoToNext, Name:="").Select
' Copy
Selection.Copy
' Turn off selection mode
Selection.ExtendMode = False
' Go to the top of the page to avoid overwriting selection
Selection.GoTo(What:=wdGoToPage, Which:=wdGoToPrevious, Name:="").Select
' Now do the insert!
For i = 1 To Int(Val(NoOfPages))
Selection.Paste
Next
I need to "clone" the current page a number of times. I do this with a
Selection object by calling Copy and then Paste a number of times which works
fine. My problem is how to select the contents of the current page?
I have tried to select the current page (se sample below) by using
Selection.GoTo but this dos'ent work if I am on the first/last page because
the selection does not move. Then how do I do it?
Any help would be appreciated
Bertrand
' Trick to go to the top of the current page
Selection.GoTo(What:=wdGoToPage, Which:=wdGoToPrevious, Name:="").Select
Selection.GoTo(What:=wdGoToPage, Which:=wdGoToNext, Name:="").Select
' Enable selection mode
Selection.ExtendMode = True
' Go to the next page
Selection.GoTo(What:=wdGoToPage, Which:=wdGoToNext, Name:="").Select
' Copy
Selection.Copy
' Turn off selection mode
Selection.ExtendMode = False
' Go to the top of the page to avoid overwriting selection
Selection.GoTo(What:=wdGoToPage, Which:=wdGoToPrevious, Name:="").Select
' Now do the insert!
For i = 1 To Int(Val(NoOfPages))
Selection.Paste
Next