Microsoft Outlook -- Pass Line Variable to Microsoft Access

T

Todd Shillam

Okay...I tried the Microsoft Access main newsgroup and didn't get an answer
to my question; hence, I'm asking the Outlook professionals. Here's my
question....

Whenever a new e-mail message is received with a pre-defined subject line, I
want a VBA script to pass line String variables (from the body of a new
message) to a Microsoft Access function (module).

If I can pass the line variables from Outlook to an Access function, I would
be all set. However, I am not sure how to capture line variables of a new
message in Outlook, and how to pass them to Access.

Any help would be greatly appreciated. Thanks in advance.

Best regards,


Todd Shillam
 
S

Sue Mosher [MVP-Outlook]

Basically, you'd have to parse the Body property of the incoming item using standard text functions like Instr() and Mid(). See http://www.outlookcode.com/codedetail.aspx?id=89 for an example.

FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_vba

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
T

tshillam

Sue,

Thanks for the help--I am know able to capture variable values from the
body of a Microsoft Outlook message. However, I want to pass variables
to a Microsoft Access function--is this possible? How do I go about
adding a Reference to the Access file or making the connection to call
the Public function(s)?

Thanks,

Todd Shillam
 
S

Sue Mosher [MVP-Outlook]

I haven't done much Access automation in years. You'd probably be better off asking about that part of your project in an Access forum.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
T

tshillam

Sue,

Thanks--I'll go back and visit the Microsoft Access group. You've been
most helpful.

Sincerely,

Todd Shillam
 
T

tshillam

Sue,

I found some code in another newsgroup--worked like a charm:

http://groups.google.com/group/micr...erences+to+microsoft+access+file&rnum=7&hl=en

Here's an exerpt of code:

Dim oAccess As Access.Application
Set oAccess = CreateObject("Access.Application")
oAccess.Visible = False
Call oAccess.OpenCurrentDatabase("\C:\db1.mdb", False)
oAccess.Run ("DoKbTest")
Call oAccess.Run("DoKbTestWithParameter", "Hello from VB Client")
oAccess.Quit
Set oAccess = Nothing


Best regards,

Todd
 

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