A
Anne P.
Hi all,
I am using the following code to insert a letterhead logo into a document:
If chkLetterhead.Value = True And cmbOffices.Value = "NYLetterhead" Then
If ActiveDocument.Bookmarks.Exists("Logo") Then
Set mBmRange = ActiveDocument.Bookmarks("Logo").Range
mBmRange = "NYLetterhead"
mBmRange.InsertAutoText
ActiveDocument.Bookmarks.Add Name:="Logo", Range:=mBmRange
End If
End If
If chkLetterhead.Value = True And cmbOffices.Value = "DCLetterhead" Then
If ActiveDocument.Bookmarks.Exists("Logo") Then
Set mBmRange = ActiveDocument.Bookmarks("Logo").Range
mBmRange = "DCLetterhead"
mBmRange.InsertAutoText
ActiveDocument.Bookmarks.Add Name:="Logo", Range:=mBmRange
End If
End If
If the bookmark named "Logo" is on the first page of the document this works
just fine. However, if the bookmark is in the header, it freezes. I am
using this same code in a different template to insert a logo and it works
just fine. The only real difference between these two documents is that the
one that works is a Fax cover sheet which *DOES NOT* have Different First
Page turned on. The other two templates that use it are a Memo and Letter
which both *DO* have Different First Page turned on.
Also, I have another question regarding headers and footers. I read the
following article on the Word MVPS page about preventing users from editing
headers/footers in a document:
http://word.mvps.org/faqs/customization/ProtectWord2000PlusHeader.htm.
First, will the code from this article work in Word 2003? And if it will,
can I change the line that reads:
Case wdEvenPagesFooterStory, wdEvenPagesHeaderStory, _
wdFirstPageFooterStory, wdFirstPageHeaderStory, _
wdPrimaryFooterStory, wdPrimaryHeaderStory
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
so that only the First Page Header cannot be changed, or does it have to
protect all headers and footers? The client wants to lock the header so
that when the document is e-mailed no one can delete the firm logo from the
header.
Thanks,
Anne P.
I am using the following code to insert a letterhead logo into a document:
If chkLetterhead.Value = True And cmbOffices.Value = "NYLetterhead" Then
If ActiveDocument.Bookmarks.Exists("Logo") Then
Set mBmRange = ActiveDocument.Bookmarks("Logo").Range
mBmRange = "NYLetterhead"
mBmRange.InsertAutoText
ActiveDocument.Bookmarks.Add Name:="Logo", Range:=mBmRange
End If
End If
If chkLetterhead.Value = True And cmbOffices.Value = "DCLetterhead" Then
If ActiveDocument.Bookmarks.Exists("Logo") Then
Set mBmRange = ActiveDocument.Bookmarks("Logo").Range
mBmRange = "DCLetterhead"
mBmRange.InsertAutoText
ActiveDocument.Bookmarks.Add Name:="Logo", Range:=mBmRange
End If
End If
If the bookmark named "Logo" is on the first page of the document this works
just fine. However, if the bookmark is in the header, it freezes. I am
using this same code in a different template to insert a logo and it works
just fine. The only real difference between these two documents is that the
one that works is a Fax cover sheet which *DOES NOT* have Different First
Page turned on. The other two templates that use it are a Memo and Letter
which both *DO* have Different First Page turned on.
Also, I have another question regarding headers and footers. I read the
following article on the Word MVPS page about preventing users from editing
headers/footers in a document:
http://word.mvps.org/faqs/customization/ProtectWord2000PlusHeader.htm.
First, will the code from this article work in Word 2003? And if it will,
can I change the line that reads:
Case wdEvenPagesFooterStory, wdEvenPagesHeaderStory, _
wdFirstPageFooterStory, wdFirstPageHeaderStory, _
wdPrimaryFooterStory, wdPrimaryHeaderStory
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
so that only the First Page Header cannot be changed, or does it have to
protect all headers and footers? The client wants to lock the header so
that when the document is e-mailed no one can delete the firm logo from the
header.
Thanks,
Anne P.