[AccessD] Outlook Automation

Daniel Waters df.waters at outlook.com
Thu Mar 21 18:04:16 CDT 2024


Hi Rocky,

Have you set the variables to the Outlook App itself?  Look back in the code you cribbed from to find those.

HTH!
Dan  

-----Original Message-----
From: AccessD <accessd-bounces+df.waters=outlook.com at databaseadvisors.com> On Behalf Of Rocky Smolin
Sent: 21 March, 2024 17:52
To: Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Subject: [AccessD] Outlook Automation

Dear List:

I am trying to create an email through Automation using late binding (in case the target machine does not have access loaded; I check for that first and bail if no outlook).

My DIMs:

Dim myolApp As Object
Dim myItem As Object

Code:
myItem.To = Me.fldTenantEmail
myItem.cc = "Kathy.Klein at arensgroup.com"
myItem.Subject = "Rent Increase Notice - " & Me.fldTenantCompany & " - " & me.fldTenantAddress & ", " & Me.fldTenantSuiteNumber

The lines for .Subject and .CC work but Myitem.To fails with Method 'To' of object '_MailItem' failed.

Me.fldTenantEmail contains Armando at fallbrookirrigation.com

If I substitute xx for Armando at fallbrookirrigation.com then it works. I'm thinking it may have something to do with the special characters?

But I have cribbed this code from another app that works.

Any ideas?

MTIA

Rocky
--
AccessD mailing list
AccessD at databaseadvisors.com
https://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list