Opening Outlook with VB

JustinCooper
JustinCooper used Ask the Experts™
on
Hello all,

I am trying to use VB to open Outlook and send an email remotely.
However, the users that are likely to be using my code have, in Outlook the Option:
When Starting Manually control conection state checked.
Found in : Tools->Services->Microsoft Exchange Server->Properties

In practicallity this means when Outlook starts a window appears asking the user
if they want to connect or work offline. What I need to do is automatically select
"Connect" from my VB code. Is this possible please?

I know I could just get the people to uncheck the option, but this is not really practical

Thanks in advance,

Justin
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
If you're using VB.net, then you can use the built in libraries for sending out emails, (assuming SMTP is enabled on the machine).
checkout http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/Q_20680237.html for more info
I'm not sure what you're asking, but if you would like to control Outlook through VB that's possible. Microsoft exposes objects of MS Office.  In a sense, you can have VB on the client, and by pressing a button you can create an Outlook session and send e-mails. Is this what you want? Trying to help.
Look at the MAPI functions and Mapi controls to see if you have to open outlook at all.


This should sove your problem !!!

You start the outlook with shell command with VB
then activate the outlook window with appactivate function with the title of the msgbox of outlook as argument
then you use the sendkeys function to press enter on that form (if connect is the default button)
or you use the sendkeys function to press the hotkey of the connect command button.

Hope that this solves your problem.

Cheers
s.sriram

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial