![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]() "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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |