We are taking text from a Rich Textbox control on a VB form and putting it into a new instance of Microsoft Word. We want to be able to edit the text in the Word document, close the document and put the edited text back into the Rich Textbox control. This is the code sample:
Private Sub cmdShowWord_Click()
Dim oDoc As Word.Document
If MSWordOpen() Then
' Add a New Document
Set oDoc = goWord.Documents.Add
' Add Information to the Document
oDoc.Range.Text = txtSentence
At this point, we want Word to "pause" so that the user can
edit the text that we placed into oDoc.Range.Text, disable
the Save button since we don't want to save the file to a
directory on the network, close the document and finally return
the text back into the Rich Text Box control on our VB form.
' Get Sentence Back From Word Document
txtSentence.Text = oDoc.Range.Text
We would appreciate any code that would help achieve our objective. Thank you.