Outlook import to Access

quezocotl

New Member
Joined
Jul 25, 2007
Messages
4
I have a 97Access mdb that automatically sends out emails. A spreadsheet, which is the source file, is imported into the mdb, and each line is sent to a recipient indicated on a field from that line.

In more understandable terms, each line in the spreadsheet contains information for specific users. One of the fields in the line contains that person's name, which is identified in an Outlook Address book. So, the first cell in the line contains the name, and that cell is used by the access mdb to determine the recipient of said line.

This access mdb is deployed on a users machine who knows nothing about access, so I need it to be automated as much as possible. All of this happens with the click of a button on a form (import spreadsheet, build sendout table, email recipients line-by-line to recipient indicated in said line).

The problem I'm having is that sometimes one of the names on the spreadsheet is misspelled, causing Outlook to throw an error (Spreadsheet says 'Rob' when Outlook only knows 'Robert,' etc.). In my ideal fix, I'd like to throw some code into the module that will import his Outlook address book, then only attempt to send the mail if the recipient matches a legit recipient in his address book. If it doesn't match, I could throw the name into an array and after it's finished let him know who, if any, failed to get the mail.

I'd like this to happen automatically every time the mdb runs, because the possible recipients are constantly changing, because people are quitting and being fired and being hired and rehired on a weekly basis. So, every time he runs the process, a new sample of his outlook address book will need to be re-imported for comparison.

Thanks,
Chris.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

quezocotl

New Member
Joined
Jul 25, 2007
Messages
4
Error...

I'm trying this fix you linked to, and I'm getting the following error

(I put the cursor in the midst of the Sub and hit the run button)

"Compile error:
User-defined type not defined"
OK - Help

After clicking OK, it highlights the first line:

Dim ol As New Outlook.Application

...as if Access doesn't know what the Outlook object is.
 

Philem

Active Member
Joined
Jan 2, 2003
Messages
282
Access may NOT know what the Outlook object is if you have not set a reference to it.

Set the reference, and let us know what happens.

HTH (y)
-P
 

quezocotl

New Member
Joined
Jul 25, 2007
Messages
4
Address List

ahaha... Syke! I actually needed to import my Global Address List, not contacts. I got the contacts to import though... I just went to the Macro's tools / properties and checked a few objects.

So, do you know how I can import a global address list?
 

Forum statistics

Threads
1,181,658
Messages
5,931,271
Members
436,785
Latest member
KingGideon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top