Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-02-2016, 09:14 AM
Ghostbuataar Ghostbuataar is offline Sending a document by email from Button, MAC compatible Windows 7 32bit Sending a document by email from Button, MAC compatible Office 2007
Novice
Sending a document by email from Button, MAC compatible
 
Join Date: May 2016
Posts: 1
Ghostbuataar is on a distinguished road
Unhappy Sending a document by email from Button, MAC compatible

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 ?
Reply With Quote
Reply

Tags
email form, vba, word 2007

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending an email otuatail Outlook 0 12-04-2015 07:32 AM
Sending a document by email from Button, MAC compatible command button that generates a popup for sending email oduntan Word VBA 4 03-21-2013 02:15 PM
Sending a document by email from Button, MAC compatible 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
Sending a document by email from Button, MAC compatible To whom am I sending email? Richard Outlook 2 05-21-2009 02:27 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:40 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft