Bernadette
06-25-2013, 08:23 AM
The following macro prompts to save the document and then sends it to Outlook. It works well but I was wondering if there is a way to save the document as a PDF? Any help is much appreciated! I am using Word 2007.
Public Sub commandbutton1_click()
Dim OL As Object
Dim EmailItem As Object
Dim Doc As Document
Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
Set Doc = ActiveDocument
Doc.Save
With EmailItem
.Subject = "Visitor Authorization"
.body = "Please find attached the authorization form." & vbCrLf & _
"" & vbCrLf & _
"Thank you," & vbCrLf & _
"" & vbCrLf & _
"Name"
.To = "name@address.ca"
.CC = "name@address.ca"
' .Importance = olImportanceNormal 'Or olImprotanceHigh Or olImprotanceLow
.importance = 2 'importance is high
.Attachments.Add Doc.FullName
.Display
End With
Application.ScreenUpdating = True
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
End Sub
Public Sub commandbutton1_click()
Dim OL As Object
Dim EmailItem As Object
Dim Doc As Document
Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
Set Doc = ActiveDocument
Doc.Save
With EmailItem
.Subject = "Visitor Authorization"
.body = "Please find attached the authorization form." & vbCrLf & _
"" & vbCrLf & _
"Thank you," & vbCrLf & _
"" & vbCrLf & _
"Name"
.To = "name@address.ca"
.CC = "name@address.ca"
' .Importance = olImportanceNormal 'Or olImprotanceHigh Or olImprotanceLow
.importance = 2 'importance is high
.Attachments.Add Doc.FullName
.Display
End With
Application.ScreenUpdating = True
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
End Sub