View Single Post
  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Remove header & footer from Envelope

Further to my last. If you save your header text as an autotext entry called
tHeader, the following macro will insert the header when required

Sub AddHeader()
Dim oSection As Section
Dim oHeader As HeaderFooter
Dim oRng As Range
On Error GoTo ErrorHandler
If Len(ActiveDocument.Path) = 0 Then
ActiveDocument.Save
End If
For Each oSection In ActiveDocument.Sections
For Each oHeader In oSection.Headers
If oHeader.Exists Then
Set oRng = oHeader.Range
With oRng
.Fields.Add oRng, wdFieldAutoText, "tHeader", False
.Fields.Update
End With
End If
Next oHeader
Next oSection
Exit Sub
ErrorHandler:
If Err.Number = 4198 Then
MsgBox "Document must be saved before adding header", _
vbCritical, "Not Saved"
End If
End Sub

http://www.gmayor.com/installing_macro.htm


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Peter K wrote:
Thxs for your reply.

For 99.99% of all my work I do need the header. It puts path & file
name in the top left in small font & today's date in the top right.
No problem with envellopes, Word is smart enough to realize that
envelopeds don't get headers & footers.

It's only when I use that Step by Step Mail Wizard, that even though I
specify 'Envelopes' inists on adding the header.

After I wrote my original question, I edited normal.dotm & deleted the
header & footer from it. (To be put right back in, the moment I was
done with this once a year thing.)Now The file name & date no longer
appear, but, an about 5/8 in. top margin is still there, putting the
return address way too low.

I could print the envelopes individually, bypassing the wizard, & all
would be fine. But, that defeats the purpose.

How can I stop the wizard from imposing that top margin or header?

Again, any help would be appreciated.


"Doug Robbins - Word MVP" wrote:

You should not put a header and/or footer in the normal.dot template.
Rather, create another template containing those features and use
that template for the documents that you create for which you want
the features.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Peter K" wrote in message
...
In Word 2007, my normal.dot includes a header. When writing
letters & ending
an Envelope to the document, everything works fine. The header &
footer appear on all text pages, but not on the envelope.

Trying to print envelopes for Xmas cards: Mailing Start Mail
Merge Step
by Step Mail Merge Wizard, I specify under document Type
'Envelopes'. Going
ahead, all envelopes get a header & a footer, which makes no sense,
apparently based on my normal.dotx.

How can I delete these headers & footers?

Any advice would be appreciated.

Peter K