Consulting

Results 1 to 5 of 5

Thread: Macro wont send auto reply.

  1. #1
    VBAX Newbie
    Joined
    Jun 2015
    Posts
    5
    Location

    Macro wont send auto reply.

    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

    Snap40.jpg

    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
    Attached Files Attached Files

  2. #2
    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.
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  3. #3
    VBAX Newbie
    Joined
    Jun 2015
    Posts
    5
    Location
    Thanks for the reply gmayor... attached is the full macro and intended results.

    mb20402
    Attached Files Attached Files

  4. #4
    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.
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  5. #5
    VBAX Newbie
    Joined
    Jun 2015
    Posts
    5
    Location
    Thanks for your help!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •