Simple code to look for a specific line

Status
Not open for further replies.

Frankmil

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Hi Diane!
I tried to look for this simple code in your forum but I didn't find it.
I always receive mail with label and without label(thank to you,I know how to extract data with label ones) , I just want to extract the line before the last one . For exemple , my mail is:
Xxxx
Thank you very much
Jone smith
Industry corp and cie

What is the vba outlook 2010 to use for looking (and copy) the one before last line (here it's jone smith).
Thank you for your help
Frank
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I don't know if you could count lines and get the next to last one, but unless a line containing 'thank' always leads the line you want, its going to be tough to do. (I assume the last line will vary.) Actually, if you can count lines, you would also need to test for content, because blank lines at the end would throw it off.

If the preceding line will always have thank in some form, try something like "thank(.*)\n(.*)\n" and pick up the second (.*)
 

Frankmil

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Hi Diane
Yes, the preceding line will always have thanks line.
But how I pick up the second (.*)?
Regards
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
C Need Help with Simple Code Correction Using Outlook 11
GregS Simple calendar sharing doesn't work Using Outlook 6
K Ask about a simple script about save a incoming mail as file on local PC Outlook VBA and Custom Forms 3
P Simple contact and project manger like MissingLink for Outlook Using Outlook 1
L Simple Macro Using Outlook 1
B Is there a simple way to share email folders w/o exchange server? Using Outlook 0
F I want simple syncing between my 3 PCs and Android devices. Using Outlook 1
H Too simple I would think but.. Using Outlook 1
D Help with simple macro - looping though all emails in my inbox Using Outlook 3
T Location and simple copying of emails and settings, OL 2010 and Win 7 64bit. Using Outlook 3
R Simple Sharing of Outlook Profile Using Outlook 1
Rupert Dragwater Is there a genuine simple way to move Eudora address to Outlook 2010 Using Outlook 2
R BCM with MS Office Accounting... Simple question BCM (Business Contact Manager) 0
P Simple Marketing Campaign Question BCM (Business Contact Manager) 1
B Simple way to insert file text - macro? Outlook VBA and Custom Forms 1
V simple move to personal folder Outlook VBA and Custom Forms 1
T Simple MAPI send and Outlook COM addin Outlook VBA and Custom Forms 3
P Color Code or highlight folders in Outlook 2016 Using Outlook 2
N Please advise code received new mail Using Outlook 0
B Outlook 2016 Unable to view images or logos on the outlook 2016 emails the same html code works well when i use outlook 2010 Using Outlook 0
S Excel vba code to manage outlook web app Using Outlook 10
S Outlook VBA How to adapt this code for using in a different Mail Inbox Outlook VBA and Custom Forms 0
S Add VBA save code Using Outlook 0
C Auto Run VBA Code on new email Outlook VBA and Custom Forms 1
witzker Pls help to change the code for inserting date in Ol contact body Outlook VBA and Custom Forms 5
I Outlook 2003 shows html code when To: field is empty Using Outlook 7
F VBA code to dock Styles whenever I write or edit an email Outlook VBA and Custom Forms 0
S Skype for business meeting vba code Outlook VBA and Custom Forms 1
R Expand VBA Permanent Delete Code Outlook VBA and Custom Forms 6
B Outlook Business Contact Manager with SQL to Excel, User Defined Fields in BCM don't sync in SQL. Can I use VBA code to copy 1 field to another? BCM (Business Contact Manager) 0
A VBA Code in Outlook disappears after first use Outlook VBA and Custom Forms 1
Alex Cotton "invalid or unqualified reference" on code that should work Outlook VBA and Custom Forms 5
F VBA to ensure a code is entered in Subject title Outlook VBA and Custom Forms 1
Z Outlook Custom Form: Adding Dropdown(Project Code) at the end of subject Outlook VBA and Custom Forms 0
D Any updates or fixes that would make this code stop working just moving emails to another folder Outlook VBA and Custom Forms 1
N Open & Save VBAProject.Otm using VBA Code Outlook VBA and Custom Forms 1
M error code 0x8DE00006 Using Outlook 1
R VBA Code to permanently delete selected email Outlook VBA and Custom Forms 10
dyny723 Outlook 2016: Code to link a contact to emails received from that contact Outlook VBA and Custom Forms 1
D Command Button code will not execute. Any suggestions Please. Outlook VBA and Custom Forms 2
V VB script code to save a specific email attachment from a given email Outlook VBA and Custom Forms 14
J Custom form code doesn't run Outlook VBA and Custom Forms 2
M code to move selected Outlook contacts to another folder Using Outlook 3
E Outlook Form - Voting Responses Not Auto Processing If Form Contains Any Code Outlook VBA and Custom Forms 0
C Need VBA code to automatically save message outside outlook and add date Outlook VBA and Custom Forms 1
S Problem running Command button code Outlook VBA and Custom Forms 2
D Help with code to move mail on receipt to another folder based on time received Outlook VBA and Custom Forms 2
C Color Code New Calendar Items Using Outlook 2
S VBA Code to move mail items from search folder to inbox subfolder Outlook VBA and Custom Forms 4
B Automation error running VB macro code Outlook VBA and Custom Forms 8

Similar threads

Top