+ Reply to Thread
Results 1 to 1 of 1

Automatic VBA Execution on New Email to Subfolder & and passing a mail item as an object

  1. #1
    Registered User
    Join Date
    06-21-2023
    Location
    LN
    MS-Off Ver
    365
    Posts
    1

    Automatic VBA Execution on New Email to Subfolder & and passing a mail item as an object

    Hi All,

    Trying to convert my outlook VBA macro to run when a new email is triaged into a folder. (inbox.triaged_emails) For example rules_x puts an email into folder triaged_emails and by this email being placed in this folder a VBA rule is applied that pushes said email into one of tow other folders triaged_emails_A and triaged_emails_B. However, i can't seem to get this to function with my current code.

    In addition I've had to moved off my original loop to a reverse loop due to the macro halting as i was amending the underlying list it was iterating on. For some reason i can't get the new way to work despite it displaying the correct content in the debug. I assume this is likely due to the fact I'm not passing it as an object but I'm not sure on the best way to do this.


    Current static implementation:

    Please Login or Register  to view this content.
    Current Implementation That Fails Due To Reverse Loop

    Please Login or Register  to view this content.

    When i add a debut line to the above the olMail.HTMLBody returns the html but I cant consume it in InStr.


    Ive attempted to follow a stackover flow link that uses the below in order to automate the above but it never seems to triage when an email comes in to the folder. Sadly i can't paste my code as i don't have access to this from home and i had to hand type the above so sorry if it does not work as expected.
    Please Login or Register  to view this content.
    Thanks
    Last edited by Jezzthelab; 06-21-2023 at 05:18 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro to Target Newest Email Item in Inbox, Process Target, move Target to subfolder
    By VBANood123 in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 02-14-2022, 05:54 PM
  2. Reply to last sent Email with Trail Mail - In SENT ITEM
    By Parth007 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2019, 02:34 AM
  3. [SOLVED] VBA to move email from inbox to subfolder
    By Marijke in forum Outlook Programming / VBA / Macros
    Replies: 4
    Last Post: 04-11-2017, 02:31 AM
  4. VBA Mail Merge execution...
    By Quint6778 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-29-2016, 08:13 PM
  5. Automatic send email (without even click send in mail software) with excel vba ??
    By alexnkc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-17-2013, 08:31 PM
  6. Moving an e-mail from a subfolder in Mailbox to the equivalent subfolder in an archive PST
    By johncassell in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 07-09-2012, 11:31 AM
  7. Automatic Execution
    By Russkie in forum Excel General
    Replies: 2
    Last Post: 03-21-2005, 03:28 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1