Programmatic Send/Receive, Rules 
Author Message
 Programmatic Send/Receive, Rules

Lo folks. I'd simply like a VB/VBA equivalent of clicking the Send/Receive
button in Outlook 2000 - or, failing that, of selecting a specific account
to send/receive under Tools --> Send/Receive.

Secondly, can I run rules from code? To automate clicking "run now" from the
Rules Wizard, selecting rules and running them? I have a VB app I'd like to
grab messages from the Inbox, so I don't want rules running immediately...
but I'd like the app to run the rules to redistribute the messages to
different folders once it's taken a look at them! Can rules be accessed from
code?

Thanks in advance,

 - Chris Paterson



Thu, 30 Dec 2004 23:56:14 GMT  
 Programmatic Send/Receive, Rules
Comments will be inline to your post...


Quote:
> Lo folks. I'd simply like a VB/VBA equivalent of clicking the Send/Receive
> button in Outlook 2000 - or, failing that, of selecting a specific account
> to send/receive under Tools --> Send/Receive.

You can drill through the commandbar collection and simulate a mouse click.
About the best examples I can find are at
http://www.slipstick.com/dev/code/sendnow.htm.

Quote:

> Secondly, can I run rules from code? To automate clicking "run now" from
the
> Rules Wizard, selecting rules and running them? I have a VB app I'd like
to
> grab messages from the Inbox, so I don't want rules running immediately...
> but I'd like the app to run the rules to redistribute the messages to
> different folders once it's taken a look at them! Can rules be accessed
from
> code?

No.  The Rules Wizard/Engine is not exposed in the Outlook or CDO object
model.


Fri, 31 Dec 2004 00:12:05 GMT  
 Programmatic Send/Receive, Rules
Aha, that's great... the CDO version hidden in the middle of that code page
was perfect. Cheers, Neo.

 - Chris Paterson



Quote:
> You can drill through the commandbar collection and simulate a mouse
click.
> About the best examples I can find are at
> http://www.slipstick.com/dev/code/sendnow.htm.



Fri, 31 Dec 2004 01:06:24 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Programmatic equivalent to Send/Receive Button

2. programmatic access to junk email rules

3. Receiving notification on Send, Receive and Delete

4. Outlook Received Attachment Rule

5. simplest programmatic method to send Outlook mail ?

6. How to send a copy BCC instead of CC in Outlook Rules Wizard

7. Send Mail Rule

8. after sending rules BCC instead CC possible?

9. Help with Rule for changing send account

10. Rules Wizard - Auto-send email

11. Send From Account, and Possible Rule?

12. Need help: Rules, Sent property, Move Item.Copy method, VBA fix

 

 
Powered by phpBB® Forum Software