![]() |
|
#1
|
|||
|
|||
|
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
|
|
| Tags |
| email form, vba, word 2007 |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sending an email | otuatail | Outlook | 0 | 12-04-2015 07:32 AM |
command button that generates a popup for sending email
|
oduntan | Word VBA | 4 | 03-21-2013 02:15 PM |
sending word document as email attachment causes format loss
|
gauntlett | Word | 1 | 04-27-2012 09:06 AM |
| Adding an Email Button to a Word Document | maddoktor | Word | 0 | 12-01-2011 01:32 PM |
To whom am I sending email?
|
Richard | Outlook | 2 | 05-21-2009 02:27 PM |