Solved sendobject and default email program (1 Viewer)

Shecky

New member
Local time
Yesterday, 20:56
Joined
Jul 29, 2021
Messages
28
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
 
then google Outlook automation.
 
Also, can you try uninstalling WLM and just reinstall it later if it fixes the problem? Just a thought...
 
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
 
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?
 
Default apps > email> Outlook (was WLM before)
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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

Back
Top Bottom