PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Extracing out data to save into a word file or excel file

Reply

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

 
Thread Tools Rate Thread
Old 03-11-2004, 08:31 PM   #1
=?Utf-8?B?SiBDaGV3?=
Guest
 
Posts: n/a
Default Extracing out data to save into a word file or excel file


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.
  Reply With Quote
Old 04-11-2004, 07:23 AM   #2
Michael Bauer
Guest
 
Posts: n/a
Default Re: Extracing out data to save into a word file or excel file

' 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)

--
Viele Grüße
Michael Bauer


"J Chew" <JChew@discussions.microsoft.com> wrote in message
news:61AAF672-00F5-45BD-BC8D-701D00DCB83F@microsoft.com...
> 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.


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off