Re: PR_BODY_HTML to PR_RTF_COMPRESSED to PR_BODY

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Michael Tissington (michael_at_nospam.com)
Date: 03/15/04


Date: Mon, 15 Mar 2004 09:53:07 -0800

Just found a function called HrRTFCompressedToText in EDKUTILS

Any idea what needs to be on the client for me to be able to use ?

-- 
Michael Tissington
http://www.oaklodge.com
http://www.tabtag.com
"Dmitry Streblechenko (MVP)" <dmitry@dimastr.com> wrote in message
news:um0ITFrCEHA.2656@TK2MSFTNGP12.phx.gbl...
> You can load the RTF into a hiden RTF control, then stream it out as plain
> text.
> In case of HTML, you can load it into an instance of IHTMLDocument2 object
> (see walkall on MSDN), then use IHTMLDocument2.body.createTextRange
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy  - Outlook, CDO
> and MAPI Developer Tool
>
>
> "Michael Tissington" <michael@nospam.com> wrote in message
> news:ObmYAArCEHA.3256@TK2MSFTNGP09.phx.gbl...
> > If I don't set STORE_HTML_OK, then I don't get PR_HTML and Outlook seems
> to
> > use PR_RTF_COMPRESSED for the html body ....
> >
> > My end point here is to be able to store the actual text of the email
> > without regard to any formatting so I don't actually need PR_HTML.
> >
> > So now I just need to be able to go from PR_RTF_COMPRESSED to PR_BODY
....
> >
> > Any thoughts ?
> >
> > -- 
> > Michael Tissington
> > http://www.oaklodge.com
> > http://www.tabtag.com
> >
> >
> > "Dmitry Streblechenko (MVP)" <dmitry@dimastr.com> wrote in message
> > news:%235q146lCEHA.596@TK2MSFTNGP12.phx.gbl...
> > > Sure. You need to encode the HTML into RTF :-)
> > > 1. Loop through HTML and prefix the opening tags with "{\*\htmltag8 "
+
> > Tag
> > > + "}" and the closing tags with "{\*\htmltag0 " + Tag + "}"
> > > 2. Prefix {, } and \ with "\"
> > > 3. Replace tabs (0x9) with "\tab "
> > > 3. Append the RTF header (look at any RTF encoded HTML in a message).
> > Note:
> > > if you plan to support intenational charsets, make sure "\ansicpg" and
> > > "\fcharset" in the header are followed by the correct code page number
> > (the
> > > same value as PR_INTERNET_CPID).
> > > Since only Outlook 97 does not natively understand HTML, Outlook 98
and
> up
> > > will decode the HTML anyway, so you don't need to worry about
> substituting
> > > the right RTF tags for each HTML tag the way Outlook does it.
> > >
> > > What will happen if you do not use STORE_HTML_OK and STORE_RTF_OK
bits?
> > Will
> > > Outlook take care of setting all 3 properties?
> > >
> > > Dmitry Streblechenko (MVP)
> > > http://www.dimastr.com/
> > > OutlookSpy  - Outlook, CDO
> > > and MAPI Developer Tool
> > >
> > >
> > > "Michael Tissington" <michael@nospam.com> wrote in message
> > > news:eX5Eb7kCEHA.2256@TK2MSFTNGP12.phx.gbl...
> > > > That's what I figure.
> > > >
> > > > STORE_HTML_OK
> > > > STORE_RTF_OK
> > > > ....
> > > >
> > > > When Outlook or MAPI copies a message to my store it only is setting
> the
> > > > PR_HTML, so this means that I must set both PR_BODY and
> > PR_RTF_COMPRESSED
> > > > ....
> > > >
> > > > So from PR_HTML I need to know how to write PR_RTF_COMPRESSED ....
> > > >
> > > > Any ideas ?
> > > >
> > > > -- 
> > > > Michael Tissington
> > > > http://www.oaklodge.com
> > > > http://www.tabtag.com
> > > >
> > > > "Dmitry Streblechenko (MVP)" <dmitry@dimastr.com> wrote in message
> > > > news:eC$5uCkCEHA.464@TK2MSFTNGP11.phx.gbl...
> > > > > Your store must update 2 other propeties if one of the three is
set.
> > > What
> > > > > are the flags you expose in PR_STORE_SUPPORT_MASK?
> > > > >
> > > > > Dmitry Streblechenko (MVP)
> > > > > http://www.dimastr.com/
> > > > > OutlookSpy  - Outlook, CDO
> > > > > and MAPI Developer Tool
> > > > >
> > > > >
> > > > > "Michael Tissington" <michael@nospam.com> wrote in message
> > > > > news:OjCW6LhCEHA.1544@TK2MSFTNGP09.phx.gbl...
> > > > > > Thanks for the pointers ...
> > > > > >
> > > > > > But given the original message has all three properties set
> > (PR_BODY,
> > > > > > PR_RTF_COMPRESSED, PR_HTML) then why when I copy the message
into
> my
> > > > store
> > > > > > do I only end up with PR_HTML ?
> > > > > >
> > > > > > This would suggest that the originating store has said not to
copy
> > > > PR_BODY
> > > > > > and PR_RTF_COMPRESSED ....
> > > > > >
> > > > > > -- 
> > > > > > Michael Tissington
> > > > > > http://www.oaklodge.com
> > > > > > http://www.tabtag.com
> > > > > >
> > > > > > "Dmitry Streblechenko (MVP)" <dmitry@dimastr.com> wrote in
message
> > > > > > news:u$ZAjugCEHA.2592@TK2MSFTNGP12.phx.gbl...
> > > > > > > That makes perfect sense - given pure RTF or HTML (either in
> > > > > PR_BODY_HTML
> > > > > > or
> > > > > > > encoded in PR_RTF_COMPRESSED), you can always extract plain
> text.
> > In
> > > > > case
> > > > > > of
> > > > > > > RTF you can use the RTF control, in case of HTML, load the
HTML
> > into
> > > > an
> > > > > > > IHTMLDocument2 object, then extract pain text using
> > > > > > > IHTMLDocument2.body.createTextRange.
> > > > > > >
> > > > > > > Dmitry Streblechenko (MVP)
> > > > > > > http://www.dimastr.com/
> > > > > > > OutlookSpy  - Outlook, CDO
> > > > > > > and MAPI Developer Tool
> > > > > > >
> > > > > > >
> > > > > > > "Michael Tissington" <michael@nospam.com> wrote in message
> > > > > > > news:eDx1$YgCEHA.2620@TK2MSFTNGP12.phx.gbl...
> > > > > > > > When Outlook/MAPI copies a message to our store the
following
> > > seems
> > > > to
> > > > > > > > happen
> > > > > > > >
> > > > > > > > 1) If PR_BODY_HTML exists then ONLY this is copied.
> > > > > > > > 2) If PR_RTF_COMPRESSED exists then ONLY this is copied.
> > > > > > > > 3) If ONLY PR_BODY exists then this is copied.
> > > > > > > >
> > > > > > > > I have tried called RTFSync ...
> > > > > > > >
> > > > > > > > If PR_RTF_COMPRESSED then to create the PR_BODY or
> > > > > > > > If PR_BODY then to create the PR_RTF_COMPRESSED
> > > > > > > >
> > > > > > > > but this does not seem to do anything.
> > > > > > > >
> > > > > > > > I guess my questions comes down to how can I have messages
> > copied
> > > to
> > > > > our
> > > > > > > > store and set all three properties (especially when the
> > originally
> > > > > > message
> > > > > > > > has them set).
> > > > > > > >
> > > > > > > >
> > > > > > > > -- 
> > > > > > > > Michael Tissington
> > > > > > > > http://www.oaklodge.com
> > > > > > > > http://www.tabtag.com
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


Relevant Pages

  • Re: PR_BODY_HTML to PR_RTF_COMPRESSED to PR_BODY
    ... > You can load the RTF into a hiden RTF control, then stream it out as plain ... > In case of HTML, you can load it into an instance of IHTMLDocument2 object ... > OutlookSpy - Outlook, CDO ... >>> the right RTF tags for each HTML tag the way Outlook does it. ...
    (microsoft.public.win32.programmer.messaging)
  • RE: New IE crash: CSS + HTML
    ... I tested this sending an HTML email into outlook and it crashed outlook ... Subject: New IE crash: CSS + HTML ... The tag with id "one" can be any tag that is 'display: ... address it crashes at is a RET instruction. ...
    (Bugtraq)
  • Re: using outlook 2007 to send an HTML

    ... I figured out how to send HTML content. ... I very much doubt the problem is in Access but is instead in Outlook. ... It may be that Outlook doesn't support the tag for security ... Tony Toews, Microsoft Access MVP ...
    (microsoft.public.access.externaldata)
  • Embedding objects
    ... There seems to be abug in outlook with regard to objects. ... The normal way to embed objects in html is as follows: ... it will show the noembed tag. ... Outlook clients (ie if restricted it shows the image and ...
    (microsoft.public.outlook)
  • Convert PR_RTF_COMPRESSED into PR_HTML
    ... I have a message with only PR_RTF_COMPRESSED (no PR_BODY and no HTML) ... How does Outlook know its an HTML email? ... Michael Tissington ...
    (microsoft.public.win32.programmer.messaging)