A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook.Send



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 10th 09, 08:07 PM posted to microsoft.public.outlook.program_vba
MUSIWA
external usenet poster
 
Posts: 6
Default Outlook.Send

What is the correct syntax to send the message in out look through VBA
object.send cause a syntax error in my computer

Set OutProg = CreateObject("outlook.application")
Set OutM = OutProg.CreateItem(olitemType.olmailitem)

With OutM
.subject = "I am trying"
.To = "My email address"
.body = "Here we go"
.Importance = Outlook.OlImportance.olImportanceNormal
MsgBox " done"
End With
OutM.Send() (syntax error here and am not sure why ????)
Exit Sub

Ads
  #2  
Old February 10th 09, 08:11 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Outlook.Send

OutM.Send

If you want to use the parentheses use this:

Call OutM.Send()

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"MUSIWA" wrote in message
...
What is the correct syntax to send the message in out look through VBA
object.send cause a syntax error in my computer

Set OutProg = CreateObject("outlook.application")
Set OutM = OutProg.CreateItem(olitemType.olmailitem)

With OutM
.subject = "I am trying"
.To = "My email address"
.body = "Here we go"
.Importance = Outlook.OlImportance.olImportanceNormal
MsgBox " done"
End With
OutM.Send() (syntax error here and am not sure why ????)
Exit Sub


  #3  
Old February 10th 09, 08:27 PM posted to microsoft.public.outlook.program_vba
MUSIWA
external usenet poster
 
Posts: 6
Default Outlook.Send

See that is just my problem I keep getting the same error
"application _define or object defined error" and debbug shows me that
statement as the problem. Ru time error 287

Did I mess up my defination of the objects?

Thanks by the way sorry for insulting your intelligence


"Ken Slovak - [MVP - Outlook]" wrote:

OutM.Send

If you want to use the parentheses use this:

Call OutM.Send()

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"MUSIWA" wrote in message
...
What is the correct syntax to send the message in out look through VBA
object.send cause a syntax error in my computer

Set OutProg = CreateObject("outlook.application")
Set OutM = OutProg.CreateItem(olitemType.olmailitem)

With OutM
.subject = "I am trying"
.To = "My email address"
.body = "Here we go"
.Importance = Outlook.OlImportance.olImportanceNormal
MsgBox " done"
End With
OutM.Send() (syntax error here and am not sure why ????)
Exit Sub



  #4  
Old February 11th 09, 12:54 AM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Outlook.Send

Do you have a VBA project reference set to the Outlook version installed
there?

Send is definitely a method of the MailItem object. Do you show either
object in the Object Browser?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"MUSIWA" wrote in message
...
See that is just my problem I keep getting the same error
"application _define or object defined error" and debbug shows me that
statement as the problem. Ru time error 287

Did I mess up my defination of the objects?

Thanks by the way sorry for insulting your intelligence


  #5  
Old February 17th 09, 05:03 PM posted to microsoft.public.outlook.program_vba
MUSIWA
external usenet poster
 
Posts: 6
Default Outlook.Send

Got it Thanks that was it I added it and now we are good. Thanks a bunch!!

"Ken Slovak - [MVP - Outlook]" wrote:

Do you have a VBA project reference set to the Outlook version installed
there?

Send is definitely a method of the MailItem object. Do you show either
object in the Object Browser?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"MUSIWA" wrote in message
...
See that is just my problem I keep getting the same error
"application _define or object defined error" and debbug shows me that
statement as the problem. Ru time error 287

Did I mess up my defination of the objects?

Thanks by the way sorry for insulting your intelligence



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2003...SEND problem...does not send the 1st time CJ Outlook - General Queries 1 September 14th 08 06:13 AM
I can't send attachments with outlook, I can send test email Harm Logan Outlook - General Queries 5 March 21st 07 07:51 PM
outlook 2003 has 2 "send" labels in the send receive drop down oceanfreightrefunds Outlook - General Queries 1 February 14th 07 10:24 PM
Some items can't be send in outlook 2003. Even after repeatly clicking the send button. baarts Outlook - General Queries 1 August 9th 06 03:52 PM
Can't send via outlook 2003 or outlook express 6, but can send to newsgroups ~AMDT~ Outlook - General Queries 5 March 29th 06 11:31 AM


All times are GMT +1. The time now is 06:35 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.