Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert a long string into Word
Message
From
31/03/2005 14:41:31
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Insert a long string into Word
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01000436
Message ID:
01000436
Views:
80
Does someone knows how to insert a long string into Word using Word Automation ?
Im finding problems using something like this...
&& Description of a piece of land
var_a = "Lote com 250,00 metros quadrados com 10,00 metros de frente para a Rua Projetada 01, " + :
        "do lado direito com 25,00 metros, confrontando com o lote 09, do lado esquerdo com 25,00" + ;         
        "metros, confrontando com o lote 11 e nos fundos com 6,91 metros confrontando com o Jd. " + ;
        "Nossa Senhora do Amparo e com 3,09 metros, confrontando com Francelino Camargo ou " + ;
        "Sucessores"	

#INCLUDE "MSWord9.h"

LOCAL oWord AS "Word.Application"
* Cria instancia se não existir
IF TYPE("oWord") <> "O"
	oWord = CREATEOBJECT("Word.Application")
ENDIF
.
oWord.VISIBLE = .F.
.
oWord.Documents.ADD(template)
.
.
.
loSelection.FIND.ClearFormatting()

* @@VAR_A
oRange = oWord.ActiveDocument.RANGE(0,0)	
#DEFINE wdReplaceAll 2
WITH oRange.FIND
	.ClearFormatting					
	.TEXT ="@@VAR_A"					
	.FORMAT = .F.
	WITH 	.Replacement										
		.ClearFormatting
		.TEXT = var_a
	ENDWITH
	lFound = .Execute( , , , , , , , , , , wdReplaceAll )	
ENDWITH
It returns this error message:
"OLE IDispatch exception code 0 from Microsoft Word: The parâmeters of the character sequence is to long..."
Problem:
I need to insert some descriptions from a string from VFP into some Word DOC's and some of those comments can be 15 lines long, how can this be done ?
Any sample somewhere ?
Also, wich is the maximum width of a string that can be passend to Word ?


Thanks in Advance.

[ ]'s
Peter
Next
Reply
Map
View

Click here to load this message in the networking platform