Forcing send & receive by code (VBA)

N

Nour

Hi,

I have an application that sends out faxes ...
The faxes are kept in the outbox waiting for the "send & receive" button
click.
How can I force by code (VBA) the "send & recevive" action to happen just
after I send the fax. I am using MS Fax.

Thanks,
Nour
 
N

Nour

Hi,

Sorry for the delay .. I was busy on other tasks.

I tried the code presented in:
http://www.outlookcode.com/d/code/sendnow.htm and no method worked for me.
What versions of access/outlook is needed.

I use a standalone PC connected with fax line, ACCESS 2002, Outlook 2002.
Also if possible, what reference should I.

Thanks,
Nour
 
S

Sue Mosher [MVP-Outlook]

Variation #2 should work on Outlook 2002.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Nour said:
Hi,

Sorry for the delay .. I was busy on other tasks.

I tried the code presented in:
http://www.outlookcode.com/d/code/sendnow.htm and no method worked for me.
What versions of access/outlook is needed.

I use a standalone PC connected with fax line, ACCESS 2002, Outlook 2002.
Also if possible, what reference should I.

Thanks,
Nour

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de news: (e-mail address removed)...
See http://www.outlookcode.com/d/code/sendnow.htm for various methods,
depending on the Outlook version.
 
N

Nour

I just tried it another time and it gives me an error on:

Set oCB = Application.ActiveExplorer.CommandBars("Menu Bar")

ActiveExplorer member not found.

Nour

Sue Mosher said:
Variation #2 should work on Outlook 2002.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Nour said:
Hi,

Sorry for the delay .. I was busy on other tasks.

I tried the code presented in:
http://www.outlookcode.com/d/code/sendnow.htm and no method worked for me.
What versions of access/outlook is needed.

I use a standalone PC connected with fax line, ACCESS 2002, Outlook 2002.
Also if possible, what reference should I.

Thanks,
Nour

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de news: (e-mail address removed)...
See http://www.outlookcode.com/d/code/sendnow.htm for various methods,
depending on the Outlook version.


Hi,

I have an application that sends out faxes ...
The faxes are kept in the outbox waiting for the "send & receive"
button
click.
How can I force by code (VBA) the "send & recevive" action to happen just
after I send the fax. I am using MS Fax.

Thanks,
Nour
 
S

Sue Mosher [MVP-Outlook]

Where is this code running? Application in this case needs to be an
Outlook.Application object.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Nour said:
I just tried it another time and it gives me an error on:

Set oCB = Application.ActiveExplorer.CommandBars("Menu Bar")

ActiveExplorer member not found.

Nour

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de news: (e-mail address removed)...
Variation #2 should work on Outlook 2002.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Nour said:
Hi,

Sorry for the delay .. I was busy on other tasks.

I tried the code presented in:
http://www.outlookcode.com/d/code/sendnow.htm and no method worked for me.
What versions of access/outlook is needed.

I use a standalone PC connected with fax line, ACCESS 2002, Outlook 2002.
Also if possible, what reference should I.

Thanks,
Nour

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de news: (e-mail address removed)...
See http://www.outlookcode.com/d/code/sendnow.htm for various methods,
depending on the Outlook version.


Hi,

I have an application that sends out faxes ...
The faxes are kept in the outbox waiting for the "send & receive"
button
click.
How can I force by code (VBA) the "send & recevive" action to happen
just
after I send the fax. I am using MS Fax.

Thanks,
Nour
 
N

Nour

Hi Sue,

I tried with : "Send All" and "All Accounts" ... but still giving me an
"Automatio error " on oCtl.Execute

here is my code:

Public Sub SendReceiveNow()

Dim oCtl As Office.CommandBarControl
Dim oPop As Office.CommandBarPopup
Dim oCB As Office.CommandBar

Dim ol As New Outlook.Application

'Use the Send/Receive on All Accounts action in the Tools
'menu to send the items from the Outbox, and receive new items
Set oCB = ol.ActiveExplorer.CommandBars("Menu Bar")

Set oPop = oCB.Controls("Tools")
Set oPop = oPop.Controls("Send/Receive")
Set oCtl = oPop.Controls("Send All") '("All Accounts")
oCtl.Execute

Set oCtl = Nothing
Set oPop = Nothing
Set oCB = Nothing
Set ol = Nothing

End Sub

Sue Mosher said:
Where is this code running? Application in this case needs to be an
Outlook.Application object.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Nour said:
I just tried it another time and it gives me an error on:

Set oCB = Application.ActiveExplorer.CommandBars("Menu Bar")

ActiveExplorer member not found.

Nour

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de news: (e-mail address removed)...
Variation #2 should work on Outlook 2002.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Hi,

Sorry for the delay .. I was busy on other tasks.

I tried the code presented in:
http://www.outlookcode.com/d/code/sendnow.htm and no method worked
for
me.
What versions of access/outlook is needed.

I use a standalone PC connected with fax line, ACCESS 2002, Outlook 2002.
Also if possible, what reference should I.

Thanks,
Nour

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de news: (e-mail address removed)...
See http://www.outlookcode.com/d/code/sendnow.htm for various methods,
depending on the Outlook version.


Hi,

I have an application that sends out faxes ...
The faxes are kept in the outbox waiting for the "send & receive"
button
click.
How can I force by code (VBA) the "send & recevive" action to happen
just
after I send the fax. I am using MS Fax.

Thanks,
Nour
 
N

Nour

I have read in: http://www.kbalertz.com/Feedback.aspx?kbNumber=290500
Send CommandBar button
It is no longer possible to use the Execute method to programmatically click
the Send button on the Outlook toolbar. Although this is not commonly done
in Outlook solutions, this change has been made to prevent malicious intent.
You receive the E_FAIL return code for all of these messages in the C or C++
programming languages.

Is this true first. If yes, then how to do it otherwise.

Thanks,

Nour


Nour said:
Hi Sue,

I tried with : "Send All" and "All Accounts" ... but still giving me an
"Automatio error " on oCtl.Execute

here is my code:

Public Sub SendReceiveNow()

Dim oCtl As Office.CommandBarControl
Dim oPop As Office.CommandBarPopup
Dim oCB As Office.CommandBar

Dim ol As New Outlook.Application

'Use the Send/Receive on All Accounts action in the Tools
'menu to send the items from the Outbox, and receive new items
Set oCB = ol.ActiveExplorer.CommandBars("Menu Bar")

Set oPop = oCB.Controls("Tools")
Set oPop = oPop.Controls("Send/Receive")
Set oCtl = oPop.Controls("Send All") '("All Accounts")
oCtl.Execute

Set oCtl = Nothing
Set oPop = Nothing
Set oCB = Nothing
Set ol = Nothing

End Sub

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de news: (e-mail address removed)...
Where is this code running? Application in this case needs to be an
Outlook.Application object.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Nour said:
I just tried it another time and it gives me an error on:

Set oCB = Application.ActiveExplorer.CommandBars("Menu Bar")

ActiveExplorer member not found.

Nour

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de news: (e-mail address removed)...
Variation #2 should work on Outlook 2002.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Hi,

Sorry for the delay .. I was busy on other tasks.

I tried the code presented in:
http://www.outlookcode.com/d/code/sendnow.htm and no method worked for
me.
What versions of access/outlook is needed.

I use a standalone PC connected with fax line, ACCESS 2002, Outlook
2002.
Also if possible, what reference should I.

Thanks,
Nour

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de news: (e-mail address removed)...
See http://www.outlookcode.com/d/code/sendnow.htm for various methods,
depending on the Outlook version.


Hi,

I have an application that sends out faxes ...
The faxes are kept in the outbox waiting for the "send & receive"
button
click.
How can I force by code (VBA) the "send & recevive" action to happen
just
after I send the fax. I am using MS Fax.

Thanks,
Nour
 
S

Sue Mosher [MVP-Outlook]

Send and Send All are two entirely different things. Only the first is
blocked by the "object model guard." It is irrelevant to your task.


What build of OUtlook 2002 are you using?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Nour said:
I have read in: http://www.kbalertz.com/Feedback.aspx?kbNumber=290500
Send CommandBar button
It is no longer possible to use the Execute method to programmatically
click
the Send button on the Outlook toolbar. Although this is not commonly done
in Outlook solutions, this change has been made to prevent malicious
intent.
You receive the E_FAIL return code for all of these messages in the C or
C++
programming languages.

Is this true first. If yes, then how to do it otherwise.

Thanks,

Nour


Nour said:
Hi Sue,

I tried with : "Send All" and "All Accounts" ... but still giving me an
"Automatio error " on oCtl.Execute

here is my code:

Public Sub SendReceiveNow()

Dim oCtl As Office.CommandBarControl
Dim oPop As Office.CommandBarPopup
Dim oCB As Office.CommandBar

Dim ol As New Outlook.Application

'Use the Send/Receive on All Accounts action in the Tools
'menu to send the items from the Outbox, and receive new items
Set oCB = ol.ActiveExplorer.CommandBars("Menu Bar")

Set oPop = oCB.Controls("Tools")
Set oPop = oPop.Controls("Send/Receive")
Set oCtl = oPop.Controls("Send All") '("All Accounts")
oCtl.Execute

Set oCtl = Nothing
Set oPop = Nothing
Set oCB = Nothing
Set ol = Nothing

End Sub

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de news: (e-mail address removed)...
Where is this code running? Application in this case needs to be an
Outlook.Application object.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



I just tried it another time and it gives me an error on:

Set oCB = Application.ActiveExplorer.CommandBars("Menu Bar")

ActiveExplorer member not found.

Nour

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de news: (e-mail address removed)...
Variation #2 should work on Outlook 2002.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Hi,

Sorry for the delay .. I was busy on other tasks.

I tried the code presented in:
http://www.outlookcode.com/d/code/sendnow.htm and no method worked for
me.
What versions of access/outlook is needed.

I use a standalone PC connected with fax line, ACCESS 2002,
Outlook
2002.
Also if possible, what reference should I.

Thanks,
Nour

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans
le
message
de news: (e-mail address removed)...
See http://www.outlookcode.com/d/code/sendnow.htm for various methods,
depending on the Outlook version.


Hi,

I have an application that sends out faxes ...
The faxes are kept in the outbox waiting for the "send & receive"
button
click.
How can I force by code (VBA) the "send & recevive" action to happen
just
after I send the fax. I am using MS Fax.

Thanks,
Nour
 
N

Nour

#10.2627.2625


Sue Mosher said:
Send and Send All are two entirely different things. Only the first is
blocked by the "object model guard." It is irrelevant to your task.


What build of OUtlook 2002 are you using?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Nour said:
I have read in: http://www.kbalertz.com/Feedback.aspx?kbNumber=290500
Send CommandBar button
It is no longer possible to use the Execute method to programmatically
click
the Send button on the Outlook toolbar. Although this is not commonly done
in Outlook solutions, this change has been made to prevent malicious
intent.
You receive the E_FAIL return code for all of these messages in the C or
C++
programming languages.

Is this true first. If yes, then how to do it otherwise.

Thanks,

Nour


Nour said:
Hi Sue,

I tried with : "Send All" and "All Accounts" ... but still giving me an
"Automatio error " on oCtl.Execute

here is my code:

Public Sub SendReceiveNow()

Dim oCtl As Office.CommandBarControl
Dim oPop As Office.CommandBarPopup
Dim oCB As Office.CommandBar

Dim ol As New Outlook.Application

'Use the Send/Receive on All Accounts action in the Tools
'menu to send the items from the Outbox, and receive new items
Set oCB = ol.ActiveExplorer.CommandBars("Menu Bar")

Set oPop = oCB.Controls("Tools")
Set oPop = oPop.Controls("Send/Receive")
Set oCtl = oPop.Controls("Send All") '("All Accounts")
oCtl.Execute

Set oCtl = Nothing
Set oPop = Nothing
Set oCB = Nothing
Set ol = Nothing

End Sub

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de news: (e-mail address removed)...
Where is this code running? Application in this case needs to be an
Outlook.Application object.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



I just tried it another time and it gives me an error on:

Set oCB = Application.ActiveExplorer.CommandBars("Menu Bar")

ActiveExplorer member not found.

Nour

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de news: (e-mail address removed)...
Variation #2 should work on Outlook 2002.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Hi,

Sorry for the delay .. I was busy on other tasks.

I tried the code presented in:
http://www.outlookcode.com/d/code/sendnow.htm and no method worked
for
me.
What versions of access/outlook is needed.

I use a standalone PC connected with fax line, ACCESS 2002,
Outlook
2002.
Also if possible, what reference should I.

Thanks,
Nour

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans
le
message
de news: (e-mail address removed)...
See http://www.outlookcode.com/d/code/sendnow.htm for various
methods,
depending on the Outlook version.


Hi,

I have an application that sends out faxes ...
The faxes are kept in the outbox waiting for the "send & receive"
button
click.
How can I force by code (VBA) the "send & recevive" action to
happen
just
after I send the fax. I am using MS Fax.

Thanks,
Nour
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top