[AccessD] Outlook Automation

Rocky Smolin rockysmolin2 at gmail.com
Sat Mar 23 08:51:00 CDT 2024


This is for one client. And they have Outlook. If I use early and one user
doesn't have it, the app will crap out with a broken reference and they'll
have to add Outlook to that user. Client is OK with that.

But actually, I found out that the whole early/late thing was not a
solution. It seems that the first test I did, the user had an email address
that just wouldn't compute - barfed on the ".To = " statement. Tried a
different record and it worked.

So now I've got to set up another 1/2 dozen or so test records and see if
this was a one-off or some other problem.

Bottom line - late binding works fine. So far. (Gotta love access...)

tks

r

On Fri, Mar 22, 2024 at 8:46 PM John Colby <jwcolby at gmail.com> wrote:

> I suggest that you do both early and late binding.  Use a global compiler
> constant to switch it.  In your code, bracket the early and late code
> segments with #if statements.  Use early to figure it out then go to late
> for production.  AFAIK you can do anything in late that you can do in
> early, you just have to know the syntax to get to the properties of things
> as well as what things are called.  Any object in the library can be pulled
> as object.
>
> The problem is that you simply cannot do "Dim X withevents" in late
> binding.  The compiler can't figure out the events that an object is going
> to have.  So automation isn't possible in late binding.  For this dev
> environment I suggest getting a copy of Office 2013 and dev in that and
> reference that.
>
> On Thu, Mar 21, 2024 at 6:59 PM Rocky Smolin <rockysmolin2 at gmail.com>
> wrote:
>
> > 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
> >
>
>
> --
> John W. Colby
> Colby Consulting
> --
> 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