badgers
Jan 11th, 2000, 05:40 AM
I want to open word and place the contents of a RichTextBox into the word document.
I then want to tell word to save the file as a text file with line breaks. If possible I would like to keep word hidden in the process.
How do I get the contents of the RichTextBox into Word?
Private Sub Command1_Click()
Dim Word As Word.Application
Set Word = New Word.Application
Word.ActiveDocument = RtB.TextRTF 'give an error
Word.ChangeFileOpenDirectory "C:\"
Word.ActiveDocument.SaveAs FileName:="ed_cs.txt", FileFormat:=wdFormatDOSTextLineBreaks, LockComments:=False, Password:="", _
AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
Word.filequit 2
Set Word = Nothing
End Sub
------------------
I am so skeptacle, I can hardly believe it!
[This message has been edited by badgers (edited 01-11-2000).]
I then want to tell word to save the file as a text file with line breaks. If possible I would like to keep word hidden in the process.
How do I get the contents of the RichTextBox into Word?
Private Sub Command1_Click()
Dim Word As Word.Application
Set Word = New Word.Application
Word.ActiveDocument = RtB.TextRTF 'give an error
Word.ChangeFileOpenDirectory "C:\"
Word.ActiveDocument.SaveAs FileName:="ed_cs.txt", FileFormat:=wdFormatDOSTextLineBreaks, LockComments:=False, Password:="", _
AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
Word.filequit 2
Set Word = Nothing
End Sub
------------------
I am so skeptacle, I can hardly believe it!
[This message has been edited by badgers (edited 01-11-2000).]