Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert a memo into MS Word
Message
De
01/12/2014 12:03:46
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01611620
Message ID:
01611628
Vues:
40
Thanks Borislav,
yes your code works here too. I forgot to mention thet !description! is within a table cell :-(

and there it does not work

P


>>I use this code from Tamar's book:
>>
>>	oRange = oWord.ActiveDocument.RANGE(0,0) && Start of document
>>	WITH oRange.FIND
>>		.TEXT ="!description!"
>>		.MatchCase = .F.
>>		.FORMAT = .F.
>>		* what to replace it with
>>		.Replacement.TEXT = lcdescription 
>>		.Replacement.FONT.Bold = .T.
>>		.Replacement.ParagraphFormat.LeftIndent = 12
>>		* go!
>>		lFound = .Execute( , , , , , , , , , , wdReplaceAll )
>>	ENDWITH
>>
>>
>>the data come from a memo field .
>>
>>i tried to use chr(13) as CR or chr(10), or both
>>
>> all of them insert a little square instead of real carriage returns
>>i attached a screen shot
>>
>>
>>i want to have multiple lines insted I get it all in one line
>>
>>what am I doing wrong??
>>
>>
>>Peter
>
>
>Thst works for me:
>
>LOCAL loWord AS Word.Application
>loWord = CREATEOBJECT([Word.Application])
>loWord.Visible = .t.
>loWord.Documents.Add()
>loWord.Selection.TypeText("!description!")
>TEXT TO lcdescription NOSHOW TEXTMERGE PRETEXT 1+2
>     This is first line
>     This is second line
>     This is thirth line
>ENDTEXT
>
>oRange = loWord.ActiveDocument.RANGE(0,0) && Start of document
>WITH oRange.FIND
>        .TEXT ="!description!"
>        .MatchCase = .F.
>        .FORMAT = .F.
>        * what to replace it with
>        .Replacement.TEXT = lcdescription 
>        .Replacement.FONT.Bold = .T.
>        .Replacement.ParagraphFormat.LeftIndent = 12
>        * go!
>        lFound = .Execute( , , , , , , , , , , 2 )
>    ENDWITH
>
Peter Cortiel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform