[AccessD] Outlook Automation

Rocky Smolin rockysmolin2 at gmail.com
Thu Mar 21 17:52:11 CDT 2024


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


More information about the AccessD mailing list