Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Excel macro worked great with Outlook, need update help for Windows 10 Mail App

Status
Not open for further replies.

JayEnn1

Automotive
Sep 29, 2015
50
0
0
US
Hello

I have an Excel macro ( Worked great with Outlook for years ) which generated an email message within Excel and sent it to Outlook.

Now, we have new employees using Windows 10 Mail App and not Outlook. Can someone point me in a direction of where
I can find resources regarding updating macros from Outlook to Windows 10 Mail app? Here's the mail code..

' INITIAL DESIGN RELEASE
Case "INITIAL DESIGN RELEASE"
htmlstring1 = Range("$E$7").Value & "-" & Range("$I$7").Value 'Email job number
htmlstring2 = "Part number: " & Range("$L$7") 'Email body part Number
htmlstring3 = "Part name: " & Range("$E$9") 'Email body description
htmlstring4 = "Customer: " & Range("$I$11").Value 'Email customer id
htmlstring5 = "Designed by: " & Range("$E$11").Value 'Email designer ID
htmlstring6 = "Release date: " & Range("$M$11") 'Email request date
htmlstring7 = "Click on link below to open design release form."
htmlstring8 = MyUNCPathandFilename ' Email body release file link
htmlstring9 = Range("$E$13").Value
htmlstring10 = Range("$E$15").Value
Select Case htmlstring10
Case "Company 1"
htmlstring11 = ""
Case "Company 2"
htmlstring11 = " - Outsourced"
Cclist = Cclist + " ;manager@company.com"
End Select
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = ToList
.Cc = Cclist
.BCC = ""
.Subject = "Company Corporation... " & Range("$E$7").Value & "-" & Range("$I$7").Value & " FIXTURE DESIGN INITIAL RELEASE." & htmlstring11
.HTMLBody = _
"<b><font size=3 color=black>" & htmlstring1 & " design is released for build.</font></b><br>" _
& "<b><font size=3 color=Green>Initial release.</font></b><br>" _
& "<font size=3 color=black>Releasing: " & htmlstring9 & "</font><br>" _
& "<font size=3 color=black>Build source: </font>" & "<b><font size=3 color=Red>" & htmlstring10 & "</font><b><br><br>" _
& htmlstring3 & "<br>" _
& MyCommentsHtml _
& htmlstring2 & "<br>" _
& htmlstring4 & "<br><br>" _
& htmlstring7 & "<br>" _
& "<a href='" & htmlstring8 & "'> " & htmlstring8 & "</a><br><br>" _
& htmlstring6 & "<br>" _
& htmlstring5 & "<br>" _
& "<font size=3 color=black>Design Engineering Department</font><br>" _
& "<img src='K:\V5 LIBRARY\START MODES\Release templates\companylogo.png'>" & "<br>"
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
 
Replies continue below

Recommended for you

Don't think the new default mail app even supports VBA like this (is there a reference in excel for the app that you can enable, check in VBE under references)?

Quick web search pops up a few older discussions that suggests it is not possible.

 
Good morning!

Thank you for your replies!
I did look into the VBE under the references but did not see anything.
Closest I saw is shown here in the picture
Captureref_thue8s.jpg


I did see some older posts like Agent666 mentioned.

Also, I developed a work-around until I come up with other solution. Rather than Excel sending all the HTML
to Outlook email I wrote out the HTML to a file onto users desktop using the " Print #FileNum " code.
From there we can copy/paste; to list, cc list, subject line, body info into a Windows 10 Mail new mail.
I know this is kind-a awkward but.. It will keep things moving forward until we find a better solution.

Thank you!
 
As stated in the link I provided, Windows Mail is only for legacy support and is descended from Outlook Express, neither of which support VBA. Nevertheless, it has an API, but you need to have someone familiar with programming in C++ to really make that work

Developer Audience
The Microsoft Visual C++ class-based interface is designed for use by C/C++ programmers. Familiarity with Component Object Model (COM) is required. Additionally, familiarity with the Windows graphical user interface and message-driven architecture may be helpful.

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! faq731-376 forum1529 Entire Forum list
 
IRstuff
Thank you and I understand more of what the situation is.
Been doing a lot of reading and so forth.
Right now it appears that we will make do as best as we can until we upgrade to Microsoft 365.
 
Status
Not open for further replies.
Back
Top