Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WORD: turn headers on and off
Message
De
07/03/2001 13:15:39
 
 
À
07/03/2001 11:44:36
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00482750
Message ID:
00482814
Vues:
8
>Hi,
>
>I am using WORD automation. I have a letter that I want to print. I have included a header that mimics my letterhead. But sometimes I don't need it. Is there a way to turn the header on and off under automation? Is there a way when not in automation mode to have WORD print the letter with or without the header without totally deleting the header??
>
>Neil

I don't know a way to print a document without the header once you put it in. Your best bet is to use two different templates - one with the header and one without.

With Automation, headers and footers are stored in a separate HeaderFooters collection for each section of the document. You access it through the Headers and Footers properties of the section object. Here's an excerpt from my book ("Microsoft Office Automation with Visual FoxPro"):

The kinds of headers and footers in a document (different first page, different on odd/even pages) are controlled through the PageSetup object and are discussed in the section "Setting up pages" earlier in this chapter. Header and footer content is stored in HeaderFooter objects, which are part of a HeaderFooters collection, accessed through the Headers and Footers properties of the Section object. Any section can have up to three of each, accessed via the constants wdHeaderFooterPrimary (1), wdHeaderFooterFirstPage (2), and wdHeaderFooterEvenPages (3).

Once you find the header you want, you can deal with its contents like any other part of a document.

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform