Hello !
I have a command button at the end of a form that saves the document then send it over email. It works great. On a Windows platform with Outlook. And that is the problem.
I would like it to be the more universal possible. At least working with MAC. At the moment, even if the MAC computer does have Outlook, it does not work (

).
Here's the code I have right now :
Code:
Private Sub CommandButton11_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 = "New order"
.Body = "New order attached !" & vbCrLf & _
"" & vbCrLf & _
"Thank you"
.To = "XXX@XYZ.com"
.Importance = olImportanceHigh 'Or olImprotanceHigh Or olImprotanceLow
.Attachments.Add Doc.FullName
.Display
End With
Application.ScreenUpdating = True
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
End Sub
What I want :
Make sure it works with outlook on MAC.
Bonus :
Make it work with any desktop based email client on both Windows and MAC (I love dreaming).
PS : I'm working with Word 2010 right now
Edit :
Here's something I use on Exel, that work but does not in word, sadly :
Code:
Application.Dialogs(xlDialogSendMail).Show arg1:="rXYZ@gmail.com", _
arg2:="Purchase order - Step"
End Sub
Anything similar in word ?