Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default e-Mail File out of Excel 2003 Macro

I am getting a type definition error on the first two DIM statements

Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
..To = StudenteMail
..CC = ""
..BCC = ""
..Subject = "Class Progress Audio Report for " & Date
Dim strbody As String
strbody = "Outstanding job today. Please keep up the great work " &
StudentName & vbNewLine & vbNewLine & _
"Kind regards" & vbNewLine & _
"Me"
..Attachments.Add ("C:\Cantillation Sounds\InstructorNotes.wav")
..Display
End With
Set OutMail = Nothing
Set OutApp = Nothing

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default e-Mail File out of Excel 2003 Macro

Try this Marvin.

Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
&tc.

Tim

Marvin wrote:
I am getting a type definition error on the first two DIM statements

Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = StudenteMail
.CC = ""
.BCC = ""
.Subject = "Class Progress Audio Report for " & Date
Dim strbody As String
strbody = "Outstanding job today. Please keep up the great work " &
StudentName & vbNewLine & vbNewLine & _
"Kind regards" & vbNewLine & _
"Me"
.Attachments.Add ("C:\Cantillation Sounds\InstructorNotes.wav")
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default e-Mail File out of Excel 2003 Macro

A good page on email is

http://www.rondebruin.nl/sendmail.htm

Try changing your code as follows:

'Dim OutApp As Outlook.Application
'Dim OutMail As Outlook.MailItem
Dim OutApp As Object
Dim OutMail As Object

Set OutApp = CreateObject("Outlook.Application")
' OutApp.Session.Logon ' may need or not
Set OutMail = OutApp.CreateItem(0) '(olMailItem)



--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Marvin" wrote:

I am getting a type definition error on the first two DIM statements

Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = StudenteMail
.CC = ""
.BCC = ""
.Subject = "Class Progress Audio Report for " & Date
Dim strbody As String
strbody = "Outstanding job today. Please keep up the great work " &
StudentName & vbNewLine & vbNewLine & _
"Kind regards" & vbNewLine & _
"Me"
.Attachments.Add ("C:\Cantillation Sounds\InstructorNotes.wav")
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default e-Mail File out of Excel 2003 Macro

Works perfect now. Many thanks!!!

"Martin Fishlock" wrote:

A good page on email is

http://www.rondebruin.nl/sendmail.htm

Try changing your code as follows:

'Dim OutApp As Outlook.Application
'Dim OutMail As Outlook.MailItem
Dim OutApp As Object
Dim OutMail As Object

Set OutApp = CreateObject("Outlook.Application")
' OutApp.Session.Logon ' may need or not
Set OutMail = OutApp.CreateItem(0) '(olMailItem)



--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Marvin" wrote:

I am getting a type definition error on the first two DIM statements

Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = StudenteMail
.CC = ""
.BCC = ""
.Subject = "Class Progress Audio Report for " & Date
Dim strbody As String
strbody = "Outstanding job today. Please keep up the great work " &
StudentName & vbNewLine & vbNewLine & _
"Kind regards" & vbNewLine & _
"Me"
.Attachments.Add ("C:\Cantillation Sounds\InstructorNotes.wav")
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
will a macro transfer to another computer if I e-mail the file? Duplatt Excel Discussion (Misc queries) 3 October 6th 07 04:43 AM
Need help with mail merge - excel 2003 to word 2003 please.. Sara Excel Discussion (Misc queries) 0 May 7th 07 11:24 PM
play wave file from Excel 2003 macro Marvin Excel Programming 0 December 26th 06 11:20 PM
Copying Excel 2003 Selection into Outlook 2003 HTML E-Mail Message [email protected] Excel Discussion (Misc queries) 0 July 10th 06 03:07 PM


All times are GMT +1. The time now is 03:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"