View Single Post
 
Old 01-03-2012, 08:06 AM
aonzo aonzo is offline Windows 7 64bit Office 2010 32bit
Novice
 
Join Date: Dec 2011
Posts: 2
aonzo is on a distinguished road
Default

thanks, i found some new code that did the job.

Please find below, in case someone was interested.

Code:
Sub FillOutlookBody()
    ActiveDocument.Content.Copy
    Dim objOutlook As Outlook.Application
    Dim objOutlookMsg As Outlook.MailItem
    Dim objInspector As Outlook.Inspector
    Dim objDoc As Word.Document
    Set objOutlook = CreateObject("Outlook.Application")
     
    Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
    With objOutlookMsg
         'Set the recipient for the new email
   .To = "fake@email.com"
    'Set the recipient for a copy
    .CC = "fake@email.com"
    'Set the subject
    .Subject = "subject"
    'The content of the document is used as the body for the email
    .Body = ActiveDocument.Content
    .Display
    End With
    Set objInspector = objOutlook.ActiveInspector
    If Not objInspector Is Nothing And objInspector.EditorType = olEditorWord Then
        Set objDoc = objInspector.WordEditor
        objDoc.Range.Paste
    End If
    Set objDoc = Nothing
    Set objOutlookMsg = Nothing
    Set objInspector = Nothing
    Set objOutlook = Nothing
End Sub
Reply With Quote