Solved sendobject and default email program (1 Viewer)

Shecky

New member
Local time
Today, 02:08
Joined
Jul 29, 2021
Messages
25
I have been using sendobject code for many years to send invoice copies through my email client which until last Friday was Windows Live Mail.
The issue I am having is that I now want Outlook to send my reports.

I have changed the default email app, but WLM is still opening when I run that code through a button.

Does the MS office library need to be referenced or is there something else that I am missing?


Code:
DoCmd.OpenReport sExistingReportName, acViewPreview, , , acHidden
    Reports(sExistingReportName).Caption = sAttachmentName    'by changing the report caption
                                                        'you effectively change the name
                                                        'used for the attachment in the
                                                        '.SendObject method
                    
    DoCmd.SendObject acSendReport, sExistingReportName, acFormatPDF, notice, , "REMOVED", "REMOVED - Your Invoice copy :" & InvoiceNumber, "Please find your Invoice copy attached."
    
    DoCmd.Close acReport, sExistingReportName
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:08
Joined
May 7, 2009
Messages
19,248
then google Outlook automation.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:08
Joined
Oct 29, 2018
Messages
21,581
Also, can you try uninstalling WLM and just reinstall it later if it fixes the problem? Just a thought...
 

Shecky

New member
Local time
Today, 02:08
Joined
Jul 29, 2021
Messages
25
I was hoping to not uninstall WLM because I would like to keep my old emails around for a bit until I feel they will no longer be needed.
I just do not understand why Outlook will not take over as the default mapi
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:08
Joined
Oct 29, 2018
Messages
21,581
I was hoping to not uninstall WLM because I would like to keep my old emails around for a bit until I feel they will no longer be needed.
I just do not understand why Outlook will not take over as the default mapi
How exactly did you change your default email client?
 

Shecky

New member
Local time
Today, 02:08
Joined
Jul 29, 2021
Messages
25
Default apps > email> Outlook (was WLM before)
 

Shecky

New member
Local time
Today, 02:08
Joined
Jul 29, 2021
Messages
25
Default mail app is set to outlook in the reg.
There are other entries for outlook and WLM under protocols and other entries but I am not certain about the effects.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:08
Joined
Feb 28, 2001
Messages
27,383
Not that it should matter, but when you changed the default mail client, did you reboot/restart your system before attempting to use it? Some changes don't take immediate effect because the programs keep stuff in memory until the next reboot.
 

Shecky

New member
Local time
Today, 02:08
Joined
Jul 29, 2021
Messages
25
Yes, have rebooted multiple times.
Uninstalling WLM may fix the issue by removing whatever entry in the registry is making it happen, but I also fear that upon uninstalling perhaps the code will generate no action and no mail program will open.
 

Shecky

New member
Local time
Today, 02:08
Joined
Jul 29, 2021
Messages
25
So I decided to take the risk and uninstall Windows Live Mail.
Everything is working through outlook now. Problem resolved.
Apparently even after setting Outlook as the default app there was still something either in the registry or somewhere else.
Thanks for the help people.
 

Gasman

Enthusiastic Amateur
Local time
Today, 07:08
Joined
Sep 21, 2011
Messages
14,528
No more ideas, sorry.
My controller bought a new computer and the gave him an office compatible program.
Despite my uninstalling the program, it left traces in the registry which interfered with some of my VBA code.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:08
Joined
Oct 29, 2018
Messages
21,581
So I decided to take the risk and uninstall Windows Live Mail.
Everything is working through outlook now. Problem resolved.
Apparently even after setting Outlook as the default app there was still something either in the registry or somewhere else.
Thanks for the help people.
Glad to hear you got it sorted out. Now it would be interesting to find out what might happen if you reinstall WLM.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 02:08
Joined
Feb 19, 2002
Messages
43,587
Apparently even after setting Outlook as the default app there was still something either in the registry or somewhere else.
Thanks for the help people.
I don't have any actual answer to this. I only remember something about - you can never have two email clients installed.
 

Users who are viewing this thread

Top Bottom