Macro to modify font of header

R

richardb

My client is a medical office that uses a master document for each patient to
keep xray and MRI reports. They begin each new report with a macro that
inserts a section break to a new page and draws in a blank report with a
"letterhead" up in the document header. The Xray reports and the MRI reports
require different letter heads because they are generated by different
departments, so I added a user form so the operator can select which blank
document to insert for the next report. However, for one of inserted
documents there is a problem that the Tahoma font in the header changes to
Times Roman. I don't know how to fix that but thought I could add code to
find the text and change the font back to Tahoma. This works except that it
leaves the Times Roman formatted text up there alongside the new Tahoma
formatted text. Example "This is my textThis is my text"

My questions are: 1) Is there a better way to approach my problem; 2) what's
missing from my code (as shown):

'
' test12 Macro
' Macro recorded 10/20/2005 and modified by RichardB
'
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
With Selection
.Text = "This is the Header"
.Font.Name = "Tahoma"
.Font.Size = 14
.Font.Bold = wdToggle
End With
ActiveDocument.Save
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub

Thank you...
 

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

Similar Threads

Macro to modify font in header 4
Macro error 5941 1
Watermark macro 3
Error using Macro recording 0
Bookmark problem 0
Macro to fix header 0
Update fields in footers 2
Out of Stack Space???? 2

Top