Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / November 2004

Tip: Looking for answers? Try searching our database.

Extracing out data to save into a word file or excel file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
J Chew - 03 Nov 2004 21:31 GMT
I work for a company that receives auto receipts for work that has been
processed and properly ingested. My question for you, is there a way for a
specific line of data to be extracted out and dropped into a XLS file or a
word doc? There is always going to be a line of data called "Summary report:"
the information that I need is contained directly after this line, there is
also always going to be in the subject line the word "receipt". I can of
course set up a folder for these but to extract the data out is where I am
running into problem. Please help if you can. Thanks.
Michael Bauer - 04 Nov 2004 08:23 GMT
' Startposition of ,"summary report:" if it is unique, regardless of
lower or upper characters:

posStart=InStr(1,mailitem.body,"summary report:",vbtextcompare)

' Setting the pos to the end of the searched string:

posStart=posStart+len("summary report:")

' Looking for the end after the searched string if this end is signed
e.g. by a "return":

posEnd=InStr(posStart,mailitem.body,vbcrlf,vbtextcompare)

' Extracting the string between start and end position:

res$=mid$(mailitem.body,posStart,posEnd-posStart)

Signature

Viele Grüße
Michael Bauer

> I work for a company that receives auto receipts for work that has been
> processed and properly ingested. My question for you, is there a way for a
[quoted text clipped - 4 lines]
> course set up a folder for these but to extract the data out is where I am
> running into problem. Please help if you can. Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.