PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming strip out leading text from a forwarded email.

Reply

strip out leading text from a forwarded email.

 
Thread Tools Rate Thread
Old 15-03-2006, 11:37 PM   #1
anonymous
Guest
 
Posts: n/a
Default strip out leading text from a forwarded email.


I'm hoping some of you Microsoft MVP can point me in the right direction...

Is there a way to strip leading text from an incoming email using VBA in
outlook?

I have email forwarded by a colleague at work (a mailing list) and I'd like
to strip out his forward info so the body of the email shows up.

I've done some VBA programming with Access and some minor stuff in Excel and
WRQ-reflections.

I was hoping someone might be able to point me in the right direction as to
how to accomplish this.

I was thinking I could run a macro on incoming mail that get's applied via a
filter.

Thanks for any suggestions!

Bruno

Please reply to group or <brunoskiba_at-hotmail.com>



"Michael Bauer" <mb@mvps.org> wrote in message
news:<ylw1hxeas3br$.1ntclkp6qm199$.dlg@40tude.net>...

> Am Wed, 8 Feb 2006 22:37:26 -0800 schrieb Leech:


>


> Try this please:


>


> Public Sub WriteFile(sPath As String, _


> sText As String, _


> Optional ByVal bAppend As Boolean _


> )


> On Error GoTo AUSGANG


> Dim lFileNr As Long


>


> lFileNr = FreeFile


>


> Select Case bAppend


> Case False


> Open sPath For Output As #lFileNr


> Case Else


> Open sPath For Append As #lFileNr


> End Select


>


> Print #lFileNr, sText;


>


> AUSGANG:


> If lFileNr Then


> Close #lFileNr


> End If


>


> If Err.Number Then Err.Raise &H800A0000 Or Err.Number, _


> Err.Source, Err.Description, Err.HelpFile, Err.HelpContext


> End Sub


>


>


> --


> Viele Gruesse / Best regards


> Michael Bauer - MVP Outlook


> -- www.vbOffice.net --


>


>


> > Hi there!


> >


> > Need Yr help.


> > I have a simple txt file and need to add "//" (these two symbols) to the


> end


> > of the file (last string). Hv tried different ways but always hv carrier


> > return code between last text string and "//".


> > example:


> > text: BLA BLA BLA ->need this BLA BLA BLA//


> >


> > but always get:


> > BLA BLA BLA


> > //


> >


> > thanks!


> >


> > exmaple code:


> > dim nf as integer


> >


> > nf = freefile


> >


> > open lpfilename for binary access write as nf


> > put nf, LOF(nf), "=="


> > close nf



  Reply With Quote
Old 17-03-2006, 10:55 AM   #2
Klaus
Guest
 
Posts: n/a
Default Re: strip out leading text from a forwarded email.

Hi,

hope I understand right.

What you could try is the following :

Normally, you do have some chars (e.g. >>) at the beginning of a
citation.
You could search the textlines for these characters (at the start of
each line) to differ between newer and elder text.

For example :

Hi, this is new text

>> and this is citation


>>>> and this is even older citation


Hope this will help you further

Klaus

  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