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:47:37 -0800

Looking at RTFLIB.H there seems to be a function called
HrTextFromCompressedRTFStream which looks like it will do what I want.
However when I try to use rtflib.lib I get duplicate definitations for
WrapCompressedRTFStream ....

Any idea how I can include rtflib in a project ?

-- 
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: Exchange 2003 communication differences
    ... you're correct that Entourage and Outlook connect to Exchange ... messages in HTML, RTF and Plain text. ... HTML, however, old mail stores still have RTF as the default. ...
    (microsoft.public.mac.office.entourage)
  • Re: Attachment sent becomes winmail.dat?
    ... nothing to do with Outlook, and as you can see for yourself, does not have RTF format, Only plain text and HTML. ... I did not know that Entourage lacked RTF. ... it can handle HTML but not consistently. ... Many other people here use plain text emailers on UNIX boxes or similar packages. ...
    (microsoft.public.mac.office.entourage)
  • Re: Windows Mail Not receiving My Attachments
    ... RTF is best used within an organization where all users use OL and in an Exchange Server environment. ... Outlook also has other options that need to be configured properly if these attachments are pictures to be displayed in OL. ... I can verify that OL03 and OL07 both function in Vista for Html and Plain Text sending/receiving non restricted attachments when RTF is not manually configured to be the composition format. ...
    (microsoft.public.windows.vista.mail)
  • =?ISO-8859-15?Q?Re:_Anh=E4nge_in_RTF-Mails_werden_beim_Empf=E4nger_nicht_a?= =?ISO-8
    ... Ich habe zwar in der Vergangenheit nicht allzu viel mit Outlook gemacht, aber die Umwandlung von dort erstellten HTML-mails in "plain-text" und Verlust der Anlagen ist mir nie begegnet. ... Ich habe vorhin auf meinem alten Notebook, auf dem OL 2003 liegt, mehrere Testmails erstellt, sowohl mit RTF, als auch mit HTML und jeweils mit Anlagen. ... Auszug aus dem Sourcecode einer unter OL 2003 erstellten mail mit RTF ...
    (microsoft.public.de.outlook)
  • 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 ... >> the right RTF tags for each HTML tag the way Outlook does it. ...
    (microsoft.public.win32.programmer.messaging)