Accessing MS Word document in OLE Container Control 
Author Message
 Accessing MS Word document in OLE Container Control

I need to do 3 things with an MS Word document hosted in an OLE Container
control on a VB form:
1. Allow the user to paste formatted text into it
2. Extract the RTF in the document
3. Restore the RTF in the document whenever the form is displayed.

Here are the problems:
1. When the OLE control is activated, the document is clipped to a narrow
horizontal band delimited by movable "bars" - how can I get the document to
be displayed using the entire OLE control window without making the user
resize it every time?
2. I can extract the RTF into a string via the clipboard, but when I try to
do step #3 above by pasting the RTF into the document, the contents aren't
displayed until the OLE control is activated by double-clicking it.  How do
I refresh the control after pasting the RTF without having to activate it?

Here's the code for step #3:

Clipboard.SetText .Fields("WordInfo"), vbCFRTF
oleWord.CreateEmbed vbNullString, oleWord.Class
With oleWord.object
    .Content.Select
    .Range.Paste
End With
oleWord.Visible = True      ' The control is sometimes hidden
Me.Show vbModal

Thanks in advance for any help.
- Michael



Fri, 25 Jun 2004 11:02:25 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Accessing MS Word document in OLE Container Control

2. Loading Word document from Access OLE field into OLE container control in VB

3. Loading Word document from Access OLE field into OLE container control in VB

4. Loading Word document from Access OLE field into OLE container control in VB

5. How do you control the location of a Word Document inside an Ole Container control

6. Trap keys pressed to ole container with word document embedded in it on win 95/98

7. Word Document in Ole Container

8. OLE Container/VB6/ADO/MS Access

9. OLE document container control

10. Lightweight OLE Document container control?

11. Replacement for the MS OLE Container Control

12. VB4 OLE Container Control Problem (Print Preview in Word)

 

 
Powered by phpBB® Forum Software