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

Send/Receive while outlook closed?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 10th 09, 08:41 PM posted to microsoft.public.outlook.program_vba
adma
external usenet poster
 
Posts: 1
Default Send/Receive while outlook closed?

I have this code to send email using Excel macro, it works fine abut the
message stays in outbox until i open outlook then it sends it. how i can send
receive even if outlook closed?
any help? thanks!


Sub ComposeMail(strto As String, strSubject As String, strbody As String,
strAttachment As String)
Dim objOL As Outlook.Application
Dim objX As Outlook.MailItem

Set objOL = New Outlook.Application
Set objX = objOL.CreateItem(olMailItem)
With objX
.To = strto
.Subject = strSubject
.Body = strbody
If strAttachment "" Then
.Attachments.Add strAttachment
End If
.BodyFormat = olFormatHTML
.Display
End With
Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "%s"
End Sub

Ads
  #2  
Old November 10th 09, 11:17 PM posted to microsoft.public.outlook.program_vba
JP[_3_]
external usenet poster
 
Posts: 201
Default Send/Receive while outlook closed?

This might not be the answer you're looking for, but why not just
leave Outlook open?

--JP

On Nov 10, 3:41*pm, "adma" u56099@uwe wrote:
I have this code to send email using Excel macro, it works fine abut the
message stays in outbox until i open outlook then it sends it. how i can send
receive even if outlook closed?
any help? thanks!

Sub ComposeMail(strto As String, strSubject As String, strbody As String,
strAttachment As String)
* * Dim objOL As Outlook.Application
* * Dim objX As Outlook.MailItem

* * Set objOL = New Outlook.Application
* * Set objX = objOL.CreateItem(olMailItem)
* * With objX
* * * * .To = strto
* * * * .Subject = strSubject
* * * * .Body = strbody
* * * * If strAttachment "" Then
* * * * * * .Attachments.Add strAttachment
* * * * End If
* * * * .BodyFormat = olFormatHTML
* * * * .Display
* * End With
* * Application.Wait (Now + TimeValue("0:00:02"))
* * Application.SendKeys "%s"
End Sub


  #3  
Old November 11th 09, 09:33 AM posted to microsoft.public.outlook.program_vba
Old Man River
external usenet poster
 
Posts: 19
Default Send/Receive while outlook closed?

Try putting a .send at the end of your With.

How are you early binding your objOL, I try that and am informed that excel
doesn't know about the Outlook class. and have to dimension as an Object and
use CreateObject.

"adma" wrote:

I have this code to send email using Excel macro, it works fine abut the
message stays in outbox until i open outlook then it sends it. how i can send
receive even if outlook closed?
any help? thanks!


Sub ComposeMail(strto As String, strSubject As String, strbody As String,
strAttachment As String)
Dim objOL As Outlook.Application
Dim objX As Outlook.MailItem

Set objOL = New Outlook.Application
Set objX = objOL.CreateItem(olMailItem)
With objX
.To = strto
.Subject = strSubject
.Body = strbody
If strAttachment "" Then
.Attachments.Add strAttachment
End If
.BodyFormat = olFormatHTML
.Display
End With
Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "%s"
End Sub

.

  #4  
Old November 11th 09, 11:06 PM posted to microsoft.public.outlook.program_vba
adma via OfficeKB.com
external usenet poster
 
Posts: 8
Default Send/Receive while outlook closed?

the same, the message stays at the outbox.
Thanks for the reply

Old Man River wrote:
Try putting a .send at the end of your With.

How are you early binding your objOL, I try that and am informed that excel
doesn't know about the Outlook class. and have to dimension as an Object and
use CreateObject.

I have this code to send email using Excel macro, it works fine abut the
message stays in outbox until i open outlook then it sends it. how i can send

[quoted text clipped - 23 lines]

.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...g-vba/200911/1

  #5  
Old November 12th 09, 08:14 AM posted to microsoft.public.outlook.program_vba
Old Man River
external usenet poster
 
Posts: 19
Default Send/Receive while outlook closed?

Hi. In Outlook on the Tools Menu choose Options. Click the Mail Setup tab -
is "Send immeadiately when connected" selected? Might help.

"adma via OfficeKB.com" wrote:

the same, the message stays at the outbox.
Thanks for the reply

Old Man River wrote:
Try putting a .send at the end of your With.

How are you early binding your objOL, I try that and am informed that excel
doesn't know about the Outlook class. and have to dimension as an Object and
use CreateObject.

I have this code to send email using Excel macro, it works fine abut the
message stays in outbox until i open outlook then it sends it. how i can send

[quoted text clipped - 23 lines]

.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...g-vba/200911/1

.

  #6  
Old November 12th 09, 08:08 PM posted to microsoft.public.outlook.program_vba
bobh
external usenet poster
 
Posts: 6
Default Send/Receive while outlook closed?

On Nov 10, 3:41*pm, "adma" u56099@uwe wrote:
I have this code to send email using Excel macro, it works fine abut the
message stays in outbox until i open outlook then it sends it. how i can send
receive even if outlook closed?
any help? thanks!

Sub ComposeMail(strto As String, strSubject As String, strbody As String,
strAttachment As String)
* * Dim objOL As Outlook.Application
* * Dim objX As Outlook.MailItem

* * Set objOL = New Outlook.Application
* * Set objX = objOL.CreateItem(olMailItem)
* * With objX
* * * * .To = strto
* * * * .Subject = strSubject
* * * * .Body = strbody
* * * * If strAttachment "" Then
* * * * * * .Attachments.Add strAttachment
* * * * End If
* * * * .BodyFormat = olFormatHTML
* * * * .Display
* * End With
* * Application.Wait (Now + TimeValue("0:00:02"))
* * Application.SendKeys "%s"
End Sub



I'm interested in doing this as well, if you find/get a resolve please
post it.
bobh.
  #7  
Old November 12th 09, 08:09 PM posted to microsoft.public.outlook.program_vba
bobh
external usenet poster
 
Posts: 6
Default Send/Receive while outlook closed?

On Nov 12, 3:14*am, Old Man River
wrote:
Hi. In Outlook on the Tools Menu choose Options. Click the Mail Setup tab -
is "Send immeadiately when connected" selected? Might help.



"adma via OfficeKB.com" wrote:
the same, the message stays at the outbox.
Thanks for the reply


Old Man River wrote:
Try putting a .send at the end of your With.


How are you early binding your objOL, I try that and am informed that excel
doesn't know about the Outlook class. and have to dimension as an Object and
use CreateObject.


I have this code to send email using Excel macro, it works fine abut the
message stays in outbox until i open outlook then it sends it. how i can send
[quoted text clipped - 23 lines]


.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...g-vba/200911/1


.- Hide quoted text -


- Show quoted text -


but you still have to open outlook in order for it to connect and send
bobh
  #8  
Old November 12th 09, 08:17 PM posted to microsoft.public.outlook.program_vba
bobh
external usenet poster
 
Posts: 6
Default Send/Receive while outlook closed?

On Nov 10, 6:17*pm, JP wrote:
This might not be the answer you're looking for, but why not just
leave Outlook open?

--JP

On Nov 10, 3:41*pm, "adma" u56099@uwe wrote:



I have this code to send email using Excel macro, it works fine abut the
message stays in outbox until i open outlook then it sends it. how i can send
receive even if outlook closed?
any help? thanks!


Sub ComposeMail(strto As String, strSubject As String, strbody As String,
strAttachment As String)
* * Dim objOL As Outlook.Application
* * Dim objX As Outlook.MailItem


* * Set objOL = New Outlook.Application
* * Set objX = objOL.CreateItem(olMailItem)
* * With objX
* * * * .To = strto
* * * * .Subject = strSubject
* * * * .Body = strbody
* * * * If strAttachment "" Then
* * * * * * .Attachments.Add strAttachment
* * * * End If
* * * * .BodyFormat = olFormatHTML
* * * * .Display
* * End With
* * Application.Wait (Now + TimeValue("0:00:02"))
* * Application.SendKeys "%s"
End Sub- Hide quoted text -


- Show quoted text -


if his situation is like mine;
I developed an Access application that has multiple users and I can
not make the assumption that all the users will have Outlook open so
when entering data on the Access data entry screen should they click
the 'Notify Manager' button I want the Noticification email to be send
in the background without user interaction and without having to
ensure that Outlook is open which so far I have NOT been able to do
using Outlook as the companies EMail client software.
So the issue is why does Outlook but the email message in it's outbox
instead of just sending it.
bobh.
  #9  
Old November 12th 09, 08:45 PM posted to microsoft.public.outlook.program_vba
adma via OfficeKB.com
external usenet poster
 
Posts: 8
Default Send/Receive while outlook closed?

thats exactly what is my problem, i have searched the net for solution but
nothing yes.



bobh wrote:
I have this code to send email using Excel macro, it works fine abut the
message stays in outbox until i open outlook then it sends it. how i can send

[quoted text clipped - 21 lines]
Â* Â* Application.SendKeys "%s"
End Sub


I'm interested in doing this as well, if you find/get a resolve please
post it.
bobh.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...g-vba/200911/1

  #10  
Old November 12th 09, 08:46 PM posted to microsoft.public.outlook.program_vba
adma via OfficeKB.com
external usenet poster
 
Posts: 8
Default Send/Receive while outlook closed?

it did not help , still puts it in the outbox




Old Man River wrote:
Try putting a .send at the end of your With.

How are you early binding your objOL, I try that and am informed that excel
doesn't know about the Outlook class. and have to dimension as an Object and
use CreateObject.

I have this code to send email using Excel macro, it works fine abut the
message stays in outbox until i open outlook then it sends it. how i can send

[quoted text clipped - 23 lines]

.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...g-vba/200911/1

 




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 2007 - how to set so it doesn't receive email when closed susankr Outlook - General Queries 3 January 13th 08 12:23 AM
Send/Receive doe not work... I can send but not receive in Outlook Aims Outlook - General Queries 0 October 31st 06 01:44 AM
Send email immediate when Outlook 2003 is closed? directjj Add-ins for Outlook 1 May 17th 06 03:36 PM
Automatic send/receive times out; manual send/receive works fine TN Outlook - Installation 1 March 17th 06 10:45 PM
Even when the program is closed, it continues to send and receive Cuervo Outlook - Installation 0 January 29th 06 11:40 PM


All times are GMT +1. The time now is 03:39 PM.


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.