
'Paste the picture in Chart area of same dimensions Kill Environ$("temp") & "\" & nameFile & ".png" 'Delete the existing PNG file of same name, if exists Sub createPNG(ByRef rngToPicture As Range, nameFile As String) 'Change the HTML below to add Header (Dear John) or signature (Kind Regards) using newline tag () Attachments.Add strTempFilePath, olByValue, 0

StrTempFilePath = Environ$("temp") & "\" & strTempFileName & ".png" 'Create the range as a PNG file and store it in temp folderĬall createPNG(rngToPicture, strTempFileName) Set Outmail = outlookApp.CreateItem(olMailItem) Set outlookApp = CreateObject("Outlook.Application") 'rngToPicture is defined as NAMED RANGE in the workbook, do modify this name before use Sub Create_Email(ByVal strTo As String, ByVal strSubject As String)
#Where is the document inspector in excel 2016 code
However, as developer, I recommend a code that's rather compatible with all versions of Excel instead of making system changes because system changes will be required on each end user's machine as well.Ĭode Compatible: Excel 2003, Excel 2007, Excel 2010, Excel 2013, Excel 2016, Office 365 If you have administrative rights then try the registry changes given at below link: Comments have been added for easy understanding and implementation. Hence, if your code suddenly stopped working after migrating to Office 365 or for any other reasons, please refer to the solutions below. In simple words, as a developer, you are bound to change your code, because neither registry changes can be made nor group policy can be modified. And, if Group Policy does not permit then these prompts do not come on-screen. GetInspector.WordEditorįor security purposes, the HTMLBody, HTMLEditor, Body and WordEditor properties all are subject to address-information security prompts because the body of a message often contains the sender's or other people's e-mail addresses. Checked Outlook settings - default is HTML text.OutEdit.Range(0).InsertBefore ("Dear " & sendName & "," & vbNewLine)

Subject = subjEmail & " (Site: " & siteName & ")" Set OutMail = OutApp.CreateItem(olMailItem) Set docEmail = (dirEmail, ReadOnly:=True)ĭim docName As String, sendEmail As String, ccEmail As String, siteName As String ' Directory of email template as word document 'directories of attachment and email templateĭim dirEmail as String, dirAttach As String Here is the relevant part of the macro: Sub SendEmail() GetInspector.WordEditor it throws:Īpplication-defined or object defined error

I looked at the VBA differences between Office 20, but couldn't see anything about changes to the inspector or word editor for message objects. It works on Office 2013, but not Office 2016. I wrote an Excel macro to send email from a spreadsheet.
