M
Matt
Hello,
Ok so I have a word document that I want to send in the body of an email
rather then as an attachment. But when it is sent it looks nothing like how
it looks in the word doc. In the doc I have graphs, excel files and other
types of charts. When the message is recieved it is just text. Any help would
be much appreciated.
---------------------code-------------------------------
Private Sub CommandButton1_Click()
Dim bStarted As Boolean
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem
On Error Resume Next
If Len(ActiveDocument.Path) = 0 Then
MsgBox "Document needs to be saved first"
Exit Sub
End If
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
..To = "(e-mail address removed)"
..Subject = "Daily Operational Report"
'Add the document as an attachment, you can use the .displayname property
'to set the description that's used in the message
..Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue,
DisplayName:="Document as attachment"
..Send
End With
If bStarted Then
oOutlookApp.Quit
End If
Set oItem = Nothing
Set oOutlookApp = Nothing
End Sub
----------------------------------------------------------------
Ok so I have a word document that I want to send in the body of an email
rather then as an attachment. But when it is sent it looks nothing like how
it looks in the word doc. In the doc I have graphs, excel files and other
types of charts. When the message is recieved it is just text. Any help would
be much appreciated.
---------------------code-------------------------------
Private Sub CommandButton1_Click()
Dim bStarted As Boolean
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem
On Error Resume Next
If Len(ActiveDocument.Path) = 0 Then
MsgBox "Document needs to be saved first"
Exit Sub
End If
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
..To = "(e-mail address removed)"
..Subject = "Daily Operational Report"
'Add the document as an attachment, you can use the .displayname property
'to set the description that's used in the message
..Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue,
DisplayName:="Document as attachment"
..Send
End With
If bStarted Then
oOutlookApp.Quit
End If
Set oItem = Nothing
Set oOutlookApp = Nothing
End Sub
----------------------------------------------------------------