Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting RTF control contents into Word 8 document
Message
From
10/09/1998 10:40:46
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
10/09/1998 10:17:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00135028
Message ID:
00135047
Views:
12
>I am trying to insert the formatted contents of a RTF control, which is bound to a memo field, into a Word doc at a bookmark location.
>Using the ww7_editgoto("bookmarkname") then insert(rtfcontrol.textrtf), I get text inserted which is stripped of the formatting stuff.
>If a manually cut and paste from the rtf control into Word, it works, however, I need to accomplish this programmatically.
>
>Any hints or solutions would be greatly appreciated.
>
>Gary B
use \temp\mycursor

*** set the LOCALEID to English
nlLocaleId=sys(3004)		&& Save local id
=sys(3006,1033)			&& We will be sending instructions in English 
wait window nowait "Creating Word Document..."

copy memo myRTF to "c:\temp\test.doc"

PUBLIC oWordDocument

oWordDocument=createobject("word.basic")	&& Create word object
with oWordDocument
	.appshow
	.fileopen("c:\temp\mydoc.doc")
        .editbookmark("Mymark",,,,1)  && Goto bookmark 
                                      && this one works in both versions
	.InsertFile("c:\temp\test.doc") 
endwith
wait clear

**** Set the LocaleId to the previous value
=sys(3006,val(nlLocaleId))
This would work with word95&97.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform