Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Embedded Word Document not painted until I click on it and activate it with the mouse
I'm generating reports in Excel and one of them has an embedded Word
document. I can create the embedded Word document just fine but I don't end up with the document painting in Excel, I have just a white box. If I click on the embedded Word document to activate it, all of my text is there and clicking away leaves me with the desired result. What am I missing to get Word to paint this? I'm inside a section that has Excel's Application.ScreenUpdating = False in case that affects anything. (wsReports is an Excel worksheet) Dim shpEmbeddedWordDoc As Shape Dim objWord As Object Set shpEmbeddedWordDoc= wsReports.Shapes.AddOLEObject(ClassType:="Word.Doc ument.8", Left:=334#, Top:=4977#, Width:=320#, Height:=144#) Set objWord = wsReports.OLEObjects(1).Object objWord.Activate objWord.StoryRanges(1).Text = "This is the contents of the document" I seem to be missing something to get this to initially draw. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Embedded Word Document not painted until I click on it and activate it with the mouse
Found out that I needed to activate it after putting in all of the content
into the doc to force it to paint. "Chad Knudson" wrote in message ... I'm generating reports in Excel and one of them has an embedded Word document. I can create the embedded Word document just fine but I don't end up with the document painting in Excel, I have just a white box. If I click on the embedded Word document to activate it, all of my text is there and clicking away leaves me with the desired result. What am I missing to get Word to paint this? I'm inside a section that has Excel's Application.ScreenUpdating = False in case that affects anything. (wsReports is an Excel worksheet) Dim shpEmbeddedWordDoc As Shape Dim objWord As Object Set shpEmbeddedWordDoc= wsReports.Shapes.AddOLEObject(ClassType:="Word.Doc ument.8", Left:=334#, Top:=4977#, Width:=320#, Height:=144#) Set objWord = wsReports.OLEObjects(1).Object objWord.Activate objWord.StoryRanges(1).Text = "This is the contents of the document" I seem to be missing something to get this to initially draw. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Printing a page that contains an Embedded Word Document | Excel Discussion (Misc queries) | |||
HELP! How to Use VBA to Activate Embedded Word Doc? | Excel Discussion (Misc queries) | |||
Print Excel Document using right mouse click | Excel Discussion (Misc queries) | |||
How do I activate the right mouse click in Excel? | Excel Discussion (Misc queries) | |||
Embedded Word document | Excel Discussion (Misc queries) |