Julien, I can't read RegExp and don't know exactly what you're looking for.
AFAIK the VBScript.dll contains RegEx, so if it helps in your situaution you
might use:
Set rx = CreateObject("VBScript.RegExp")
The sample you're referring to contains almost everything I could tell you.
It shows how to detect the format and how to work with the differences.
Finding a + is very easy, e.g.:
Dim pos&
pos=Instr(1, Item.Body, "+")
If it returns a value>0 then that's the position where the character is
found. Finding an upper cased word is more complicated. Without RegExp I'd
probably loop through all the text and check each character:
Dim s$, i&
s = "Some TEXT Here"
For i = 1 To Len(s)
Select Case Asc(Mid(s, i, 1))
Case 65 To 90
Debug.Print "upper case at: " & i
Case 32
Debug.Print "blank space at: " & i
End Select
Next
Please play with that sample. It finds upper cases and blank spaces in plain
text. In HTML it might be more complicated, e.g. ' ' causes a blank
space, too.
The next difficult thing is to find a line. In plain text it's quite easy,
there are only vbCRLF or vbLF that causes a new line. In HTML is a lot more.
I can't list ad hoc all tags which causes a new line; <br>, <p> and <div>
are probably the most common ones. From the position where you found your
prefix you have to search forwards and backwards to find the tags which tell
you where the line begins and ends. You search forwards with Instr, and
backwards with InstrR.
For testing you could use a simple string like:
Dim s$
s="<p>row ONE here</p><p>row +Two here</p>"
Play with it, use different keywords/tags until your code finds everything.
--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Keep your Outlook categories organized!
http://www.shareit.com/product.html?productid=300120654&languageid=1
(German:
http://www.VBOffice.net/product.html?pub=6)
Am Sun, 25 Feb 2007 08:59:40 +0100 schrieb julien Touche:
Michael Bauer [MVP - Outlook] wrote on 20/02/07 7:25:
Julien, the MailItem's BodyFormat property tells you the format. Read
HTMLBody and look for '+ ' with Instr. You then need to identify the tags
left and rigth from the found '+ ' that cause a line break, like <br>,
etc. Then either enclose it in <b></b> or add a Style attribute.
sorry, could you precise more. i'm a beginner with outlook macro
something like:
http://www.outlookcode.com/codedetail.aspx?id=1526
thanks
regards