View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
lieven lieven is offline
external usenet poster
 
Posts: 10
Default printout method on embedded word document fails

I have a word document embedded in an excel worksheet

when i try to print the document from vba i get an automation error.

my code is something like this

sub test()
dim owordapp as word.application
dim oworddoc as word.document
dim oembobj as oleobject

set oembobj=thisworkbook.somesheet.oleobjects("mydoc")
oembobj.activate

set owordapp=oembobj.object.application
set oworddoc=owordapp.activedocument

oworddoc.printout

......
end sub

using office 2003 on xp sp2 system