Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm receiving the following error:
Compile error: user-defined type not defined It's not recognizing this: Dim objOutlk As New Outlook.Application 'Outlook I've compared it to others online, and it looks the same, but I must be missing something? The code is below. Any help would be much appreicated! Thanks! Sub SendEmails() Application.ScreenUpdating = False Dim Row, Col As Integer Dim ConfDate, UName, UNumber As String Row = 2 ConfDate = Application.InputBox("Enter the date attestation should be received: eg (Friday August 18, 2006") UName = Application.InputBox("Enter your name as it will appear at the bottom of the email") UNumber = Application.InputBox("Enter your phone number as it will appear at the bottom of the email") Workbooks.Open Filename:="[server path]\Business Leaders.xls" Range("A2").Activate Do If Cells(Row, 1).Value = "Investigate" Then MsgBox ("One file found where investigation is required- Name Investigate.xls") Else MsgBox "Click to Send Email" Dim objOutlk As New Outlook.Application 'Outlook Dim objMail As MailItem 'Email item Dim strMsg Const olMailItem = 0 'Create a new message Set objOutlk = New Outlook.Application Set objMail = objOutlk.CreateItem(olMailItem) objMail.To = Cells(Row, 1).Text objMail.cc = Cells(Row, 2).Text objMail.Subject = "User Verification " & " - " & Cells(Row, 1).Text & " " & Date$ 'Add the body strMsg = Null strMsg = "Hello " & Cells(Row, 2).Text & vbCrLf & vbCrLf [etc...] |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I get my Excel macro to automatically send mail using Outl | Excel Programming | |||
Send mail problem | Excel Programming | |||
How to send a mail from excel macro using Lotus notes... | Excel Programming | |||
Macro to automatically open a website or send an e-mail in excel | Excel Discussion (Misc queries) | |||
send mail with MAPI problem | Excel Programming |