Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combining multiple word documents into one
Message
De
06/04/2004 12:02:50
 
 
À
06/04/2004 08:26:15
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00892459
Message ID:
00892644
Vues:
13
Well, I'm 'close', but at the end my page count gets recalced, and I don't want it to...

I tried Cetin's code, but because I have section formatting that I have to reset, I did the following...

oWord = CREATEOBJECT('Word.Application')
oWord.WordBasic.Fileopen('c:\blank.doc')
DIMENSION aDocs[4]
STORE 'C:\TEST1.DOC' TO aDocs[1] && has "page 1 of 3"
STORE 'C:\TEST2.DOC' TO aDocs[2] && has "page 1 of 2"
STORE 'C:\TEST3.DOC' TO aDocs[3] && has "page 1 of 9"
STORE 'C:\TEST4.DOC' TO aDocs[4] && has "page 1 of 7"


oWord.Selection.InsertFile(aDocs[1])

FOR nCounter = 2 TO 4
oWord.WordBasic.EndOfDocument(0) && go to the end
oWord.Selection.InsertBreak(2) && insert new section break
oWord.Selection.PageSetup.TextColumns.SetCount(1) && back to 1 column
WITH oWord.Selection.Sections(1).Footers(1)
.PageNumbers.RestartNumberingAtSection = .t.
.PageNumbers.StartingNumber = 1
ENDWITH
oWord.Selection.InsertFile(aDocs[nCounter])
ENDFOR
oWord.Visible = .t.

Now, this works...except that once I have my big document at the end, the first time I do a page preview or a print, it 'renumbers' the total page count...so the first page of document #3 now says 'Page 1 of 17', instead of 'Page 1 of 9'. I need a way to tell MS word, "don't recalc the page count". Any ideas?

Thanks for your help,
Kevin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform