Link to home
Start Free TrialLog in
Avatar of xactdesign
xactdesignFlag for United States of America

asked on

Send Outlook message to SQL server via toolbar button

I want to create a toolbar button in Outlook that will allow me to take a highlighted e-mail in Outlook and pass the body and subject of the message to a Web form?

I am currently copying and pasting the content into the form fields and I want to now automate this process.

Thanks
Avatar of David Lee
David Lee
Flag of United States of America image

Hi, xactdesign.

There are several ways to do this.  You could do it through a web service or you could write directly to the SQL database using something like ADO.  
Avatar of xactdesign

ASKER

OK.  I would preferably like to do it through ADO but I need a way to associate the e-mail to a customer prior to inserting the record.  I felt that passing it to a Web form and then selecting the customer from a drop down would be easiest.  I really don't care how I get there, I am just trying to eliminate copying and pasting these e-mails into text fields.

The SQL server is on a remote host, not local.  This is another reason for wanting to send the message body and subject to a form on my Web site and then submitting it.

I would appreciate some examples of how to accomplish this, that would help me so much.
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hey thanks for the code.

When I run the code in Outlook I get the following error:

Runtime Error 91

Object variable or with bloack variable not set

on this line
 objField1.Value = olkMsg.Subject
Nevermind, I forgot to upload my web page.  It worked great.