Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mail Merge Size Limitation
Message
De
01/03/2007 15:55:58
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01199398
Message ID:
01200097
Vues:
15
Here is the code that merges the table data into the WORD doc
		lcConnection = ;
			"DSN=FoxPro Files - Word;UID=;PWD=;SourceDB=" + ADDBS(JUSTPATH(lcTempDataSource)) + ;
			";SourceType=DBF;Exclusive=No;BackgroundFetch=No;Collate=MACHINE;Null=Yes;Deleted=Yes;"

		lcSelect = "SELECT * FROM " + lcTempName

		lnSelectArea=select()

		oWord.Documents.Open(lc_file_name, .F., .F., .F., "", "", .F., "", "", 0)

		oFormLetter = oWord.ActiveDocument


		oWord.ActiveDocument.MailMerge.OpenDataSource( lcTempDataSource, 0, .F.,,.T.,,,,,,, lcConnection, lcSelect)
		oWord.ActiveDocument.MailMerge

		WITH oWord.ActiveDocument.MailMerge
			.Destination = 0
			.MailAsAttachment = .F.
			.MailAddressFieldName = ""
			.MailSubject = ""
			.SuppressBlankLines = .F.

			WITH .DataSource
				.FirstRecord = 1
				.LastRecord = -16
			ENDWITH
			.Execute(.T.)
		ENDWITH

		oFormLetter.Close(0)

		*!*	IF THIS.lSave and !EMPTY(This.cSaveAsName) THEN
		*!*		IF !EMPTY(This.cSaveAsFolder) THEN
		*!*			oWord.ChangeFileOpenDirectory(This.cSaveAsFolder)
		*!*		ENDIF

		oWord.ActiveDocument.SAVEAS(lcOutPutFile, 0)
		oWord.ActiveDocument.close(0)

		OWord.quit
I can see all of the data in the memo field, but it gets truncated once I merge it into the WORD doc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform