Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word quirks? Am I taking the right approach?
Message
De
07/12/2000 10:04:45
Carol Dewar
Magram Computer Services Llc
Saugerties, New York, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00449903
Message ID:
00450362
Vues:
35
I'll take out oWordObj's initial .visible = .F. and see if that help's.
Thanks, Carol

Here is a pared down snipped for 1 doc. without most of the updating code:
...
*- Open empty overall Word Doc
IF TYPE('oAllWordObj')='U'
oAllWordObj = CREATEOBJECT("Word.Application")
ENDIF
WITH oAllWordObj
.WINDOWSTATE=2 &&Minimized
* .VISIBLE=.F.
.Documents.ADD
ENDWITH
*- Open empty Word Doc
IF TYPE('oWordObj')='U'
oWordObj = CREATEOBJECT("Word.Application")
ENDIF
WITH oWordObj
.WINDOWSTATE=2 &&Minimized
.VISIBLE=.F.
ENDWITH
...
IF gaSel(6)
*- Schedule A Description
DO PrintDescr
*- Append to overall Report
WITH oAllWordObj
.SELECTION.InsertFile((gcLocPath + "\Schedule A Description.Dot"))
*- Insert a page break #DEFINE wdSectionBreakNextPage 2
.SELECTION.InsertBreak (2)
ENDWITH
ENDIF
...
WITH oWordObj
.QUIT
ENDWITH
*- Show Overall Word Doc
WITH oAllWordObj
*- Get rid of last page break
.Selection.EndKey (6) && wdStory=6
.Selection.MoveLeft (1,1,1) && wdCharacter=1, Count=1, wdExtend=1
.Selection.Delete (1) && wdCharacter=1
.WINDOWSTATE=1 &&wdWindowStateMaximize = 1
.VISIBLE=.T.
.ActiveDocument.SAVEAS (gcLocPath + "\Title Report.Doc")
ENDWITH
...
PROCEDURE PrintDescr
*- Get update data
...
DELETE FILE (gcLocPath +"\Schedule A Description.Dot")
COPY FILE (gcProgLoc + "\Template\Schedule A Description.Dot" ) ;
TO (gcLocPath +"\Schedule A Description.Dot" )
*- Open Word Doc for testing
IF TYPE('oWordObj')='U'
oWordObj = CREATEOBJECT("Word.Application")
ENDIF
WITH oWordObj
.VISIBLE=.F.
.Documents.OPEN (gcLocPath + "\Schedule A Description.Dot")
...
*- Select bookmarks and type in updates
...
.ActiveDocument.Bookmarks("Description").SELECT
.SELECTION.TypeText (Curtemp.Descript1)

.Documents.SAVE
.Documents.CLOSE
ENDWITH

*- Cleanup
USE IN curTemp
RETURN
ENDPROC

Carol Dewar
Magram Computer Services
Carol Dewar
Magram Computer Services LLC
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform