View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Word Document Object on excel Sheet

Maybe a bit of sideways thinking - get Word to send it

Sub EmailWordOLE()
Dim ole As OLEObject
Dim objWd As Object ' Word.Document
Dim objWdRng As Object ' Word.Range
Dim objMailItem As Object ' Outlook.MailItem

Set ole = ActiveSheet.OLEObjects(1) ' or say "Object 1"
' if this fails need to activate/deactivate the embedded Wrd
Set objWd = ole.Object

Set objMailItem = objWd.MailEnvelope.Item
With objMailItem
.To = "
.Subject = "Embedded Word in Excel"
.Save ' to drafts
'.Send ' triggers "program is trying to send.." msg in Outlook
End With

End Sub

Regards,
Peter T



"K" wrote in message
...
Just last question Peter if you answer this for me then i'll be
successful on what i am doing. So far your code working perfectly if
i want to copy contents of Word.Document object onto excel Sheet range
in same format. What code i need if i want all contents of
Word.Document object which i got on excel sheet onto email body in
same format. I know this is tricky one as i am looking answer for
this one from very long time and i had little help from Ron's site but
not achived what i wanted as there is no clipboard paste system in
outlook 2007 by vba. Please be kind little more to me as i already had
you valueable time and advise me what should i be doing to get exact
result on email body as it appears on Word.Document object.