Microsoft Office Tutorials and References
In Depth Information
Remote Control with Outlook E-mail Message
'Use this object to send message without¶
'security warning¶
Set objSafeMail = CreateObject("Redemption.SafeMailItem")¶
Set objSafeMail.Item = objMail¶
'Redemption Additional stops here¶
'1- Verify Subject¶
If objSafeMail.Subject <> strSubject Then Exit Sub¶
'2- Verify if file is existing¶
'' File name is supposed to be send in¶
'' body section of incoming email message¶
strFileName = objSafeMail.Body¶
'File name must be written in parenthesis¶
'Parse required file name¶
fileNameStart = InStr(strFileName, "(")¶
fileNameEnd = InStr(strFileName, ")")¶
'Verify if file name is a valid string¶
If fileNameStart = 0 Or fileNameEnd = 0 Or _¶
fileNameEnd < fileNameStart Then Exit Sub¶
strFileName = Trim(Mid(strFileName, fileNameStart + 1, _¶
fileNameEnd - fileNameStart - 1))¶
'Verify if file is existing¶
If Dir(strFileName) = "" Then Exit Sub¶
'Create reply email¶
'Set same object as the reply that would be send back¶
Set objSafeMail = objMail.Reply¶
With objSafeMail¶
'Custom reply message¶
.Body = strReplyMsg & vbCrLf & .Body¶
'Insert Attachment¶
.Attachments.Add strFileName¶
'Send reply¶
End With¶
End Sub¶
The sender’s name, reply string and the subject line should be set as desired.
The macro runs automatically. Quit Outlook and re-launch to activate tracking
incoming e-mail messages.
Tip: Additional checks can be added to increase security. For every additional check, an
additional If-Then statement needs to be added.
Search JabSto ::

Custom Search