PDA

View Full Version : Macro wont send auto reply.



mb20402
06-20-2015, 11:13 AM
I recently upgraded to Office 2013 (Outlook) and have been receiving an error when attempting to process a few of my macros that sends out an generic message

13745

I attached a word document with the text we are using to get around the "post denied" message.

These macros were created before I took overthis position. Not sure what might cause this, any help anyone can provide withbe appreciated.

Mark

gmayor
06-21-2015, 12:26 AM
Your document lists only part of the relevant code, so it is not possible to evaluate it properly, and without a sample message, it is not possble to check the tortuous

Mid(myItem.Body, InStr(1, myItem.Body, "@") - (InStr(1, myItem.Body, "@") - InStr(1, myItem.Body, "Email")) + 6, _
InStr(InStr(1, myItem.Body, "@"), myItem.Body, "Phone") - (InStr(1, myItem.Body, "Email") + 6))produces the intended result. Post the full macro and the body text to be evaluated.

mb20402
06-22-2015, 07:28 AM
Thanks for the reply gmayor... attached is the full macro and intended results.

mb20402

gmayor
06-22-2015, 10:04 PM
The problem revolves around

Set myInspector = Application.ActiveInspector
If Not TypeName(myInspector) = "Nothing" Then If TypeName(myInspector.CurrentItem) = "MailItem" Then Set myItem = myInspector.CurrentItem

If you change that to

Set myItem = ActiveExplorer.Selection.Item(1)
If myItem.Class = OlObjectClass.olMail Then
Set MailSendItem = Outlook.CreateItem(olMailItem)
Else
MsgBox "No message selected"
Exit Sub
End If
it should work provided something is selected.

mb20402
02-01-2016, 04:16 PM
Thanks for your help!