font changes in letterhead macro
From: Tom Esker (tjesker_at_yahoo.com)
Date: 05/19/04
- Next message: Keb: "ListBox items disappear upon Show statement"
- Previous message: zSplash: "Assign keyboard shortcut - won't!"
- Next in thread: Charles Kenyon: "Re: font changes in letterhead macro"
- Reply: Charles Kenyon: "Re: font changes in letterhead macro"
- Messages sorted by: [ date ] [ thread ]
Date: 19 May 2004 11:54:10 -0700
I recorded a macro using Word 2002 that inserts letterhead into the
header of a new document based on a separate template file. It works
great except that the font of the text in the header changes to
whatever font was used in the document. How can I make the font in
the letterhead text stay put and not affect the font of the rest of
the text in the document? Below is the macro:
Sub NewLH2()
'
'' Macro recorded 05/19/2004 by tje
'
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
ChangeFileOpenDirectory "F:\DATA\Workgroup Templates\"
Documents.Open FileName:="""D&B continous letterhead.dot""", _
ConfirmConversions:=False, ReadOnly:=False,
AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
WritePasswordDocument:="", WritePasswordTemplate:="", Format:=
_
wdOpenFormatAuto
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.Copy
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Copy
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Windows(2).Activate
Selection.PasteAndFormat (wdPasteDefault)
Selection.TypeBackspace
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub
Thanks
Tom Esker
- Next message: Keb: "ListBox items disappear upon Show statement"
- Previous message: zSplash: "Assign keyboard shortcut - won't!"
- Next in thread: Charles Kenyon: "Re: font changes in letterhead macro"
- Reply: Charles Kenyon: "Re: font changes in letterhead macro"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|