Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Printing a page that contains an Embedded Word Document JLMHoss Excel Discussion (Misc queries) 2 July 22nd 08 09:56 PM
HELP! How to Use VBA to Activate Embedded Word Doc? Wuddus Excel Discussion (Misc queries) 1 September 14th 07 04:38 PM
Print Excel Document using right mouse click Randesonzz Excel Discussion (Misc queries) 0 October 11th 06 03:43 PM
How do I activate the right mouse click in Excel? Kcm Excel Discussion (Misc queries) 0 March 28th 06 08:14 AM
Embedded Word document bforster1 Excel Discussion (Misc queries) 0 November 2nd 05 08:50 PM


All times are GMT +1. The time now is 12:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"