Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Placing bookmarks after another bookmark

Status
Not open for further replies.

kalle82

Technical User
Apr 2, 2009
163
SE
Hi!

Im trying to place bookmarks after each other, now im using this code: But it just ends up with all bookmarks getting posted on the same spot and then only the last entry is visible.

How do i post bookmarks after another?

Here is my code..

With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="text1"
.DefaultSorting = wdSortByLocation
.ShowHidden = False
End With
ActiveDocument.Bookmarks(text1).Range.Select
Selection.InsertAfter

With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="text2"
.DefaultSorting = wdSortByLocation
.ShowHidden = False
End With
ActiveDocument.Bookmarks(text2).Range.Select
Selection.InsertAfter

With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="text3"
.DefaultSorting = wdSortByLocation
.ShowHidden = False
End With
With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="text4"
.DefaultSorting = wdSortByLocation
.ShowHidden = False
End With

With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="text5"
.DefaultSorting = wdSortByLocation
.ShowHidden = False
End With

With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="text6"
.DefaultSorting = wdSortByLocation
.ShowHidden = False
End With

With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="text7"
.DefaultSorting = wdSortByLocation
.ShowHidden = False
End With
Selection.InsertBreak Type:=wdPageBreak
With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="text8"
.DefaultSorting = wdSortByLocation
.ShowHidden = False
End With
 
Have a look at the Collapse method.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I cant figure it out.. I must be really nooby or dumb..

I think i get a problem add those Selection.TypeParagraph between every bookmark... not to get them deleted.. After using the macro twice it gives me a blank page at the bottom..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top