vba - Outlook Get Other Emails in Email Thread--UniqueBody -


i using vba format outbound email messages in way before sending. example, want remove first column tables embedded in email. use following code:

private sub application_itemsend(byval item object, cancel boolean)     dim wd word.document     set wd = activeinspector.wordeditor     dim tb word.table     each tb in wd.tables         tb.columns(1).delete     next tb end sub 

the above code works perfectly. however, problem want format my email text. often, responding or forwarding else's email, means text of previous email in same inspector window. don't want format text/images/etc. of previous emails in thread. how can achieved?

i know each email within thread--although they're in same window--is individual unit. know because when reading email part of thread, move mouse, see

enter image description here

on right side of screen, indicating next part of thread is. when composing new email (reply or forward) part of thread, above buttons not shown, still see blue horizontal line separating different parts of thread each other.

i thinking maybe can search first occurrence of line in email, , apply formatting until point. however, appears line isn't text or regular formatting searchable in normal sense. in fact, if copy email text (before sending), , paste word, line disappears.

any suggestions? thanks!

update

my question has nothing "conversation view" found in versions 2010 , later. outlook 2010 allows view other emails in thread in 1 group. want, however, able loop through (via code) emails in thread within same email. so, if there email "a", , reply, "b", , reply, "c", c contain b beneath it, , beneath that, all within same email. in pseudo-code, want following:

private sub application_itemsend(byval item object, cancel boolean)     dim wd word.document     dim smail subemail     dim tb word.table     set wd = activeinspector.wordeditor     each smail in wd         each tb in wd.tables             tb.columns(1).delete         next tb         exit     next smail end sub 

update

i found similar feature in exchange web services, called uniquebody. see here. that's i'm looking for, not exchange.

why not "from:" chr(13) "sent:" ? outlook going put tags in email regardless of came from.

assume entire body of emails a, b, c in example above in sbody:

sub getfirstthread()     dim olitem outlook.mailitem     dim stext string      set olitem = activeexplorer.selection.item(1)     sbody = olitem.body     i=1     while < len(sbody)         if asc(mid(sbody, i, 1)) = 13 'look from:             if mid(sbody, + 1, 5) = "from:"                 'we found start of email b                 nposeb =             end if         end if         i=i+1     wend      '...do nposeb end sub 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -