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 All emails in Outbox and Quit using VBA



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 31st 10, 09:57 PM posted to microsoft.public.outlook.program_vba
Steph_canoe
external usenet poster
 
Posts: 3
Default Send All emails in Outbox and Quit using VBA

Hi,

I have MS Access creating emails objects in Outlook using a macro. I want to
send them all and close outlook after.

1-Open Outlook
2-Send all emails in the outbox folder
3-Close Outlook

How can I achieve it using VBA? Using command buttons does not seem to work
since my Outlook is in French,

I'm using Outlook 2003 SP3.

Thank You

Stephane
Ads
  #2  
Old May 31st 10, 10:06 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default Send All emails in Outbox and Quit using VBA

You're not trying to use command button captions, are you? Use the IDs
instead, with the FindControl method. They're language-neutral. The ID for
Send All should be 5577.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54



"Steph_canoe" wrote:

Hi,

I have MS Access creating emails objects in Outlook using a macro. I want to
send them all and close outlook after.

1-Open Outlook
2-Send all emails in the outbox folder
3-Close Outlook

How can I achieve it using VBA? Using command buttons does not seem to work
since my Outlook is in French,

I'm using Outlook 2003 SP3.

Thank You

Stephane

  #3  
Old June 1st 10, 03:13 PM posted to microsoft.public.outlook.program_vba
Steph_canoe
external usenet poster
 
Posts: 3
Default Send All emails in Outbox and Quit using VBA



"Sue Mosher [MVP]" wrote:

You're not trying to use command button captions, are you? Use the IDs
instead, with the FindControl method. They're language-neutral. The ID for
Send All should be 5577.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54



"Steph_canoe" wrote:

Hi,

I have MS Access creating emails objects in Outlook using a macro. I want to
send them all and close outlook after.

1-Open Outlook
2-Send all emails in the outbox folder
3-Close Outlook

How can I achieve it using VBA? Using command buttons does not seem to work
since my Outlook is in French,

I'm using Outlook 2003 SP3.

Thank You

Stephane


How would I write my code than:

Public Sub SendReceiveNowDev()

' Instantiate an Outlook Application object.
Set objOutlook = CreateObject("Outlook.Application")

'Set Btn =
Application.ActiveExplorer.CommandBars.FindControl (msoControlButton, 5577)
Btn.Execute

'Stop Outlook
objOutlook.Quit

End Sub

Seems not to work.
  #4  
Old June 1st 10, 03:45 PM posted to microsoft.public.outlook.program_vba
Steph_canoe
external usenet poster
 
Posts: 3
Default Send All emails in Outbox and Quit using VBA

Here is my updated code but is not working yet:

Public Sub SendReceiveNowDev()
Dim objOutlook As Outlook.Application
Dim objCB As Office.CommandBar

On Error Resume Next

' Instantiate an Outlook Application object.
Set objOutlook = CreateObject("Outlook.Application")

'Then use the Send/Receive on All Accounts
Set objCB =
Application.ActiveExplorer.CommandBar.FindControl( msoControlButton, 5577)
objCB.Execute

Set objCB = Nothing
Set objOutlook = Nothing

'Stop Outlook
objOutlook.Quit

End Sub

"Steph_canoe" wrote:



"Sue Mosher [MVP]" wrote:

You're not trying to use command button captions, are you? Use the IDs
instead, with the FindControl method. They're language-neutral. The ID for
Send All should be 5577.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54



"Steph_canoe" wrote:

Hi,

I have MS Access creating emails objects in Outlook using a macro. I want to
send them all and close outlook after.

1-Open Outlook
2-Send all emails in the outbox folder
3-Close Outlook

How can I achieve it using VBA? Using command buttons does not seem to work
since my Outlook is in French,

I'm using Outlook 2003 SP3.

Thank You

Stephane


How would I write my code than:

Public Sub SendReceiveNowDev()

' Instantiate an Outlook Application object.
Set objOutlook = CreateObject("Outlook.Application")

'Set Btn =
Application.ActiveExplorer.CommandBars.FindControl (msoControlButton, 5577)
Btn.Execute

'Stop Outlook
objOutlook.Quit

End Sub

Seems not to work.

 




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
Mail stuck in outbox, can't delete,won't send, retards send/rec. Great Golfer Outlook - General Queries 2 June 10th 08 06:06 PM
How to make emails send from outlook instead of going into outbox Louise Outlook - General Queries 3 October 27th 06 03:56 AM
When using send/recieve outlook has quit looking for new message tommain Outlook - Installation 1 June 9th 06 07:10 AM
How cah i hide the send/receive when i quit the program glab Outlook - General Queries 1 June 4th 06 06:43 PM
My emails won't send. They just sit in my Outbox. missxtina182 Outlook - General Queries 3 March 13th 06 07:38 AM


All times are GMT +1. The time now is 04:35 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.