Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Save without Header and Footer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Word.user - 11 Jan 2008 05:48 GMT
Hi,
I have application which launches a wrod template file, when I save it, I
want to just save the text part of it and not the header and footer.
How is it possible?

Thanks in Advance
Stefan Blom - 11 Jan 2008 09:50 GMT
The easiest way would be to use a template where the headers and footers are
blank. But if you are saying that you want a macro to delete header and
footer contents, you could use something like this:

Sub DelHeaderFooter()
   Dim s As Section
   For Each s In ActiveDocument.Sections
       s.Headers(wdHeaderFooterEvenPages).Range.Text = ""
       s.Headers(wdHeaderFooterFirstPage).Range.Text = ""
       s.Headers(wdHeaderFooterPrimary).Range.Text = ""

       s.Footers(wdHeaderFooterEvenPages).Range.Text = ""
       s.Footers(wdHeaderFooterFirstPage).Range.Text = ""
       s.Footers(wdHeaderFooterPrimary).Range.Text = ""

   Next s
End Sub

Signature

Stefan Blom
Microsoft Word MVP

> Hi,
> I have application which launches a wrod template file, when I save it, I
> want to just save the text part of it and not the header and footer.
> How is it possible?
>
> Thanks in Advance
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.