sacanale
Aug 27th, 2000, 08:14 PM
I have an Access 97 MDB with a Memo field and an OLE Object field (among other fields). My VB6 app allows users to add, edit, and view the Memo field contents from an RTF control and allows them to add and change the OLE Object from within an OLE control.
Users can then select any number of these Memos and objects from a treeview and the app will create an external .rtf file that combines all(using "open RTFname for Output" and "Print #" statements).
I add the OLE objects (either linked or embeded)to the external RTF file with the following code which I believe is quite crude.
Any ideas for a better way of handling this???
'After setting the data control to the correct record:
.OLE1.AppIsRunning = True
Clipboard.Clear
.OLE1.Copy
.RichTextBox1.SetFocus
DoEvents
SendKeys "^{v}" 'Pastes the clipboard contents into the
'RichTextBox
SendKeys "^{Home}" 'moves cursor to start of object
SendKeys "^+{down}" 'Selects the entire object
DoEvents
Print #1, Me.RichTextBox1.SelRTF ' adds object to RTF file
Print #1, "/sect" 'create new section in RTF file
There has to be a better way! Thanks
Users can then select any number of these Memos and objects from a treeview and the app will create an external .rtf file that combines all(using "open RTFname for Output" and "Print #" statements).
I add the OLE objects (either linked or embeded)to the external RTF file with the following code which I believe is quite crude.
Any ideas for a better way of handling this???
'After setting the data control to the correct record:
.OLE1.AppIsRunning = True
Clipboard.Clear
.OLE1.Copy
.RichTextBox1.SetFocus
DoEvents
SendKeys "^{v}" 'Pastes the clipboard contents into the
'RichTextBox
SendKeys "^{Home}" 'moves cursor to start of object
SendKeys "^+{down}" 'Selects the entire object
DoEvents
Print #1, Me.RichTextBox1.SelRTF ' adds object to RTF file
Print #1, "/sect" 'create new section in RTF file
There has to be a better way! Thanks