RTF2 Control Export Save

  • Thread starter Thread starter John Paul Kemp
  • Start date Start date
J

John Paul Kemp

Is there a way to export the contents of the RTF Control
to an RTF file?
With the Microsoft RTF control (no longer supported) we
could use two steps and use the common control Dialog with
a:

me!ocxCommon.ShowSave
Me!Summary.savefile Me!ocxCommon.Filename, 0

I'm not sure how this could be done with the RTF2 Control.

Any help would be greatly appreciated.
 
Hi John,
I will add this feature to the next release. In the meantime a little
bit of code will work:

Private Sub Command12_Click()
On Error GoTo Err_Command12_Click

Dim Fnum As Long
Dim s As String
Dim sName As String
sName = "C:\Test.rtf"

Fnum = FreeFile
Open sName For Binary As Fnum

s = Me.RTFcontrol.Object.RTFtext

Put Fnum, , s
Close Fnum

Exit_Command12_Click:
Exit Sub

Err_Command12_Click:
MsgBox Err.Description
Resume Exit_Command12_Click

End Sub

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top