+ Reply to Thread
Results 1 to 3 of 3

Outlook specific text to Excel VBA Stops after first match

  1. #1
    Registered User
    Join Date
    10-18-2014
    Location
    England
    MS-Off Ver
    2010
    Posts
    5

    Outlook specific text to Excel VBA Stops after first match

    I wrote a code to pull data from outlook to excel, And its 80% working It does pull info but not from the whole email.

    I receive emails in the same format with pricing and other info on them. These are for purchase orders what have more than 1 line usually. They are in this format:

    Item Number : 00001

    Vendor Sales Order Number :

    Vendor Material Number :

    SAP Material Number :

    Vendor Description :

    SAP Description :

    Vendor Quantity : 30.000 EA

    SAP Quantity : 30.000 EA

    Quantity UOM : EA

    Vendor Delivery Date : 20.09.2014

    SAP Delivery Date : 20.09.2014

    Action Request :

    Following details does not match for PO line item 00001

    Vendor Price : USD 0.00 for 1 EA

    SAP Price : USD 0.01 for 1 EA

    Item Number : 00002

    Vendor Sales Order Number :

    Vendor Material Number :

    SAP Material Number :

    Vendor Description :

    SAP Description :

    Vendor Quantity : 70.000 EA

    SAP Quantity : 70.000 EA

    Quantity UOM : EA

    Vendor Price : USD 3.90 for 1 EA

    SAP Price : USD 3.90 for 1 EA

    Vendor Delivery Date : 20.09.2014

    SAP Delivery Date : 20.09.2014

    Action Request :

    Quantity and Requested Date all matched with PO. Item 00002


    As you can see from the code i am pulling multiple things from these emails that have the same beginning string. Most of the time these templates come in via email with more than one line item. After it pulls line 1, the code moves to the next email without searching the entire body of the email for further matches that are present in some. How can i fix this?

    ( I put the extra text fields in place if i need them to add more criteria later )

    Please Login or Register  to view this content.
    Last edited by cgcustomcomputers; 10-18-2014 at 02:00 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Outlook specific text to Excel VBA Stops after first match

    Hello cgcustomcomputers,

    Did you check that the Ubound of vText is greater than -1? The Split method creates a 1_D array with the first element starting at zero.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    10-18-2014
    Location
    England
    MS-Off Ver
    2010
    Posts
    5

    Re: Outlook specific text to Excel VBA Stops after first match

    Quote Originally Posted by Leith Ross View Post
    Hello cgcustomcomputers,

    Did you check that the Ubound of vText is greater than -1? The Split method creates a 1_D array with the first element starting at zero.
    I have not, newer to coding and learning fast. What needs to be changed?

+ 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. Outlook to excel VBA stops searching body after first match
    By cgcustomcomputers in forum Outlook Programming / VBA / Macros
    Replies: 4
    Last Post: 10-23-2014, 08:41 AM
  2. [SOLVED] Outlook email upon specific text in cell
    By ciapul12 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-21-2014, 06:40 PM
  3. Outlook Forwarding Script Errors Out and Stops Rule
    By dipique in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 11-14-2013, 03:46 PM
  4. Add to Excel from Outlook when a email body contain a specific text
    By mathewfer in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 05-08-2013, 08:28 AM
  5. [SOLVED] Index/Match/Match....Stops without completing the match
    By irsles in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-14-2012, 10:16 PM

Tags for this Thread

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