Bookmark problem

L

LEU

I am replacing the cover pages to my documents. In my macro after I delete
the old cover pages, I copy and install the new cover pages. When this
happens two bookmarks on the first page and two bookmarks on the second page
do not show up. Any idea why all the other bookmarks but these four copy into
my documents?


Dim objSection As Section
Dim objRange As Range
Dim objHeaderFooter As HeaderFooter
Dim oBkRange As Range

With ActiveDocument
.UpdateStylesOnOpen = True
.AttachedTemplate = ""
.XMLSchemaReferences.AutomaticValidation = True
.XMLSchemaReferences.AllowSaveAsXMLWithoutValidation = False
End With
Selection.Bookmarks("\Page").Range.Delete
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.WholeStory
Selection.Cut
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

Documents.Open FileName:="C:\Procedure Master Templates\Pro Master Pg1.doc", _
ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
wdOpenFormatAuto, XMLTransform:=""
Selection.WholeStory
Selection.Copy
ActiveDocument.Close
Selection.PasteAndFormat (wdPasteDefault)
ActiveWindow.ActivePane.VerticalPercentScrolled = 7
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Set objSection = Nothing
Set objRange = Nothing
Set objHeaderFooter = Nothing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top