Re: PR_BODY_HTML to PR_RTF_COMPRESSED to PR_BODY
From: Michael Tissington (michael_at_nospam.com)
Date: 03/15/04
- Next message: Michael Tissington: "Re: PR_BODY_HTML to PR_RTF_COMPRESSED to PR_BODY"
- Previous message: Dmitry Streblechenko \(MVP\): "Re: PR_BODY_HTML to PR_RTF_COMPRESSED to PR_BODY"
- In reply to: Dmitry Streblechenko \(MVP\): "Re: PR_BODY_HTML to PR_RTF_COMPRESSED to PR_BODY"
- Next in thread: abc5594def: "Re: PR_BODY_HTML to PR_RTF_COMPRESSED to PR_BODY"
- Reply: abc5594def: "Re: PR_BODY_HTML to PR_RTF_COMPRESSED to PR_BODY"
- Messages sorted by: [ date ] [ thread ]
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 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
- Next message: Michael Tissington: "Re: PR_BODY_HTML to PR_RTF_COMPRESSED to PR_BODY"
- Previous message: Dmitry Streblechenko \(MVP\): "Re: PR_BODY_HTML to PR_RTF_COMPRESSED to PR_BODY"
- In reply to: Dmitry Streblechenko \(MVP\): "Re: PR_BODY_HTML to PR_RTF_COMPRESSED to PR_BODY"
- Next in thread: abc5594def: "Re: PR_BODY_HTML to PR_RTF_COMPRESSED to PR_BODY"
- Reply: abc5594def: "Re: PR_BODY_HTML to PR_RTF_COMPRESSED to PR_BODY"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|