+ Reply to Thread
Results 1 to 2 of 2

Copy the body of an incoming email to a tab in an Excel workbook then run an Excel macro

  1. #1
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    580

    Copy the body of an incoming email to a tab in an Excel workbook then run an Excel macro

    I've got a big headache...

    I am fairly good at working with VBA with Excel; I'd probably be very good if my memory served me better (Thank Goodness for the folks on the Excel side of this board for all their help!!!), but I am lost in trying to work this out in Outlook VBA.

    When an eMail comes in
    with a Subject of "Supplies"
    I want to
    Verify Excel Workbook "Inventory.xlsm" is open, if not, open it.
    Copy the body of the email to a tab named "Supplies Import"
    Starting at cell "B4"
    Then have Excel run a sub/macro named "UpDate"

    It should be so easy! That is part of my headache - I searched and tried working with some examples for the "copy" part - I couldn't even get that to work. Then I also tried finding how it was that I once caused code to run when an incoming email matched my specifications, something like "Run a script" and I couldn't even find that. About the only thing I was successful at was turning on macros... pathetic...

    Anyway, I really appreciate your consideration and help!

  2. #2
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    580

    Re: Copy the body of an incoming email to a tab in an Excel workbook then run an Excel ma


    No problem Bruce, I am glad to help. After half a day of research and testing, your first problem is that for some strangely unfathomable reason we have to counter the fact that Microsoft decided to hide the optional rule on incoming email that would allow us to be able to select "Run a Script". It is stated that this was to improve security, but as you would not only have to select this rule but previously further enter code into VBA module and then additionally select the script to run on your installation, hiding the rule does not make any more sense than hiding the ability to run any program on a computer. Maybe there is a good reason, but I don't know of it. Anyway, the solution for this can be found here.

    Next, after cobbling together items from several websites of good folks that posted code, try the following:


    Please Login or Register  to view this content.
    NOTE: I had to use the term (FilePath) instead of using the normal convention of a "lesser than" sign followed by the word FilePath and then a "greater than" sign; otherwise, the board's firewall, Securi, thought there was embedded HTML code and kept rejecting the post. And at first I thought it was because of my bad sense of humor... Anyway, where you see (FilePath), I have the proper path to the file included.

    Then you will probably want to "selfcert" the Outlook VBA module for otherwise you will be plagued with warnings - for that, please refer to this article.

    Now, honestly, as I don't know the exact nature of a good portion of the above code, I have little idea as to how to augment or improve, if possible, but I can say that it works.

+ 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. copy body of email to excel spreadsheet
    By bruno2580 in forum Excel General
    Replies: 1
    Last Post: 12-03-2017, 03:05 AM
  2. Copy and paste Excel range as picture into Outlook email body using excel vba
    By ExcelDoc in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-17-2016, 09:29 PM
  3. copy email body into excel sheet
    By mb12345 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2014, 06:19 AM
  4. Replies: 0
    Last Post: 02-21-2013, 04:46 AM
  5. excel workbook to copy word document and format in email body
    By Dabbler39 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-03-2012, 02:36 PM
  6. Copy part of email body to Excel
    By JuJuBe in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-10-2012, 11:15 PM
  7. Replies: 2
    Last Post: 08-01-2012, 02:47 PM

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