Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word - replace in headers
Message
De
21/10/2009 19:20:50
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01429439
Message ID:
01430526
Vues:
47
>>I want to automatically replace some text; the user can decide to put a placeholder in the main document, in a header, or in a footer. I didn't find an option to search (or search and replace) throughout the entire document, including headers and footers. Do I have to do two or three separate searches?
>>
>>TIA,
>>
>Hilmar,
>
>Please check Re: Replace in word header Thread #1085969 for solution.

Thanks... and excuse me for not answering earlier.

Unfortunately, I didn't manage to make it work. Adapting the sample code, I wrote the following:
This.oDoc.Sections(1).Headers(1).Range.Find.Execute(tcFindText, .F., .F., .F., .F., .F., .T., 1, .F., tcReplaceText, 2)
Where This.oDoc is a reference to the current document, and tcFindText contains a text that actually occurs in the header.

After trying a few other combinations, I found that the above command doesn't give any error message... but it doesn't replace anything, either. Any ideas, what I might be doing wrong? Using Word 2003, by the way.

TIA,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform