I have been experimenting with the COM interface settings from Microsoft Word with VBA. I have been able to 1) print a document to a PDF file, 2) Print a document to a PDF file and attach the PDF file to a email using the Email Client. However, when I try to 3) print a document to a PDF file and send as an attachment using the EmailSmtp settings I am getting a runtime error on each statement that includes the EmailSmtp settings defined in the documentation.
'Email client settings.
If bEmailWithClient Then
'These all work as described
.SetProfileSetting “EmailClientSettings.Enabled”, bEmailWithClient 'Enables the EmailClient action
.SetProfileSetting “EmailClientSettings.Recipients”, strRecipients 'Recipients separated with ;
.SetProfileSetting “EmailClientSettings.Subject”, strEmailSubj 'Subject line of the E-mail
.SetProfileSetting “EmailClientSettings.Content”, strEmailBody 'Body text of the E-mail
.SetProfileSetting “EmailClientSettings.AddSignature”, bEmailAddPDFSig
'Email smtp settings
If bEmailWithSMTP Then
'Even though these settings are in the documentation, they aren’t recognized.
'All resulting in a Run Time Errors e.g., "The property “EmailSmpt.Enabled” does not exist!
.SetProfileSetting “EmailSmtp.Enabled”, bEmailWithSMTP
.SetProfileSetting “EmailSmtp.UserName”, UserName
.SetProfileSetting “EmailSmtp.Password”, ServerPW 'Password that is used to authenticate at the server
.SetProfileSetting “EmailSmtp.Port”, Port
'and so on
Can anyone suggest what I might be doing wrong? End If