Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word automation
Message
De
24/05/2012 08:23:53
 
 
À
23/05/2012 14:02:26
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01544165
Message ID:
01544250
Vues:
39
>one more question:
>here is my code to create a doc and type in the name address and salutaion
>then I minimize vfp
>then I type in Word itself
>when I get out I get messeges from word to save the normal.dotm file I cancel and get several more. very anoying
>
>
>
>#include "word10.h"
>#DEFINE CR CHR(13)
>#DEFINE LF CHR(11)
>
>LOCAL lcAddress AS STRING,	;
>	lcMailName AS STRING,	;
>	lcSalutation AS STRING
>*:Global oDocument,	 ;
>oForm,				 ;
>oRange,				 ;
>oWord as word.application
>oForm		 = oApp.GetFormObj([D_PCONTACT], [O])
>lcSalutation = oForm.txtSalutation.VALUE
>lcAddress	 = STRTRAN(oForm.edtAddress.VALUE, CHR(13)+CHR(10), CHR(11))
>lcMailName	 = oForm.edtMailName.VALUE
>
>
>
>oWord = CREATEOBJECT([word.application])	&& Create word object
>WITH oWord
>	oDocument = .documents.ADD()
>	oRange	  = oDocument.RANGE()
>	oRange.InsertAfter(CR)
>	oRange.InsertAfter(lcMailName + LF)
>	oRange.InsertAfter(lcAddress + CR + CR + CR)
>	oRange.InsertAfter(lcSalutation + CR + LF)
>
>
>
>	.ActiveDocument.SAVEAS(ADDBS(THISFORM.DocFolder) + THISFORM.DocName)
>	_SCREEN.WINDOWSTATE = 1
>	.VISIBLE = .T.  && Show word app
>	.ACTIVATE  && Make it the active foreground app
>ENDWITH
>oRange	  = NULL
>oDocument = NULL
>oWord	  = NULL
>THISFORM.RELEASE()
>
>
I don't see anything there that would modify the Normal template. All I can suggest is taking it apart bit by bit to see which things you're doing trigger the prompt. Or just set oWord.DisplayAlerts to .F.

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

Click here to load this message in the networking platform