Missing Outlook type library Excel 2011 for Mac

briano216

New Member
Joined
Jun 4, 2011
Messages
4
Hi

I'm a teacher and I'm hoping to be able to create some vba code in Excel so that parents can be automatically emailed with information. But when my code attempts to create an Outlook.Application object I get the following error message:
"User defined type not defined"

I have gone to references looking for a type library for outlook but there doesn't seem to be one. The code I'm using is below:

Dim OutMail As Object
Dim OutApp As Outlook.Application
Set OutApp = New Outlook.Application
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = Sheets("Parent Data").Range("E4")
.CC = ""
.BCC = ""
.Subject = Sheets("Parent Data").Range("A2")
.Body = Sheets("Parent Data").Range("A3")
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing

Can anyone help me?
Thanks
Briano216
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
I found the answer out myself from this webpage:
http://host171.hostmonster.com/pipe...fficeformachelp.com/2010-November/000069.html

I tested it and it works brilliantly. Here is my code now:


Dim pstrAppleScript As String
Dim pstrReturn As String

pstrAppleScript = "tell application ""Microsoft Outlook""" & Chr(13) & _
"set theAccount to pop account ""jdoe_internode""" & Chr(13) & _
"tell drafts of theAccount" & Chr(13) & _
"set tmp to make new outgoing message with properties {subject:""subject"", content:""body"", account:theAccount}" & Chr(13) & _
"end tell" & Chr(13) & _
"make new to recipient at tmp with properties {email address:{name:""John Doe"", address:""johndoe@abc.au""}}" & Chr(13) & _
"make new cc recipient at tmp with properties {email address:{name:""Jane Doe"", address:""janedoe@abc.com""}}" & Chr(13) & _
"send tmp" & Chr(13) & _
"end tell"
MacScript (pstrAppleScript)
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,224,594
Messages
6,179,794
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top