Click here to Skip to main content
15,896,118 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: RE: I could use some help here Pin
Naji El Kotob18-Jul-07 2:33
Naji El Kotob18-Jul-07 2:33 
GeneralRe: RE: I could use some help here Pin
Colin Angus Mackay18-Jul-07 2:43
Colin Angus Mackay18-Jul-07 2:43 
GeneralRe: RE: I could use some help here Pin
dienadel18-Jul-07 15:50
dienadel18-Jul-07 15:50 
AnswerThe rules Pin
leckey18-Jul-07 2:55
leckey18-Jul-07 2:55 
GeneralRe: The rules Pin
Paul Conrad18-Jul-07 6:11
professionalPaul Conrad18-Jul-07 6:11 
AnswerRe: RE: I could use some help here Pin
manni_n18-Jul-07 8:07
manni_n18-Jul-07 8:07 
QuestionHi,Correctly uncompressing RTF text Pin
MartyK200717-Jul-07 22:48
MartyK200717-Jul-07 22:48 
AnswerRe: Hi,Correctly uncompressing RTF text Pin
Dave Kreskowiak18-Jul-07 4:31
mveDave Kreskowiak18-Jul-07 4:31 
You've got several problems. The lack of anyone using this API with C# or VB.NET is one of them, so documentation and support is lacking.

First, I think your declaration has to look more like:
Private Declare Auto Function WrapCompressedRTFStream Lib "mapi32.dll" ( _
    <MarshalAs(UnmanagedType.Interface)> ByVal lpCompressedRTFStream As ComTypes.IStream, _
    ByVal ulFlags As UInt32, _
    <MarshalAs(UnmanagedType.Interface)> ByVal lpUncompressedRTFStream As ComTypes.IStream) _
        As Integer

I have no way of testing this!

Second. You create an lpSource stream, but you never associate that stream with the incomming data. It's a stream that points to nothing. Some thing with your lpTarget. It also points to God knows what. You haven't told either of these object where the source and destination streams are actually supposed to get/write their data.
'  OK...You've created a couple of Streams.  What are they looking at??  Nothing!
Dim lpsource As ADODB.Stream = New ADODB.Stream ' Microsoft ADODB Com object reference
Dim lptarget As ADODB.Stream = New ADODB.Stream
...
Try
' Great! You set the stream types, but you still haven't told the source stream
' where to get it's data from!
lpsource.Type = StreamTypeEnum.adTypeText
lptarget.Type = StreamTypeEnum.adTypeText
 
' Open what stream??
lpsource.Open()

' I have no idea what this line is doing, nor why it's even here.
lpsource.WriteText(objMail.Fields(CdoPR_RTF_COMPRESSED).Value)

WrapCompressedRTFStream(lpsource, STORE_UNCOMPRESSED_RTF, lptarget)
' OK.  Now you've got the source stream wrapped.  But you don't read anything and
' you don't write anything to any stream.  All you did was wrap the source for
' decompression!
??????

From what I've seen in the docs for WrapCompressed... the stream you should be reading to get the uncompressed RTF is the lptarget stream.

I can't tell you exactly how to fix these problems. I have nothing to test any code with that will supply a compressed RTF in an email.


A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: Hi,Correctly uncompressing RTF text Pin
MartyK200718-Jul-07 4:48
MartyK200718-Jul-07 4:48 
QuestionForm Capture Pin
Ahmad Zaidi17-Jul-07 22:21
Ahmad Zaidi17-Jul-07 22:21 
AnswerRe: Form Capture Pin
The ANZAC18-Jul-07 1:46
The ANZAC18-Jul-07 1:46 
GeneralRe: Form Capture Pin
Ahmad Zaidi19-Jul-07 0:27
Ahmad Zaidi19-Jul-07 0:27 
Questionvb.net exe Pin
Jayesh Talsaniya17-Jul-07 22:09
Jayesh Talsaniya17-Jul-07 22:09 
AnswerRe: vb.net exe Pin
Steven J Jowett18-Jul-07 1:22
Steven J Jowett18-Jul-07 1:22 
GeneralRe: vb.net exe Pin
Jayesh Talsaniya18-Jul-07 2:08
Jayesh Talsaniya18-Jul-07 2:08 
Questioncrystal with vb.net package Pin
Jayesh Talsaniya17-Jul-07 21:55
Jayesh Talsaniya17-Jul-07 21:55 
AnswerRe: crystal with vb.net package Pin
Naji El Kotob18-Jul-07 0:11
Naji El Kotob18-Jul-07 0:11 
GeneralRe: crystal with vb.net package Pin
Jayesh Talsaniya18-Jul-07 0:45
Jayesh Talsaniya18-Jul-07 0:45 
GeneralRe: crystal with vb.net package Pin
Steven J Jowett18-Jul-07 2:08
Steven J Jowett18-Jul-07 2:08 
GeneralRe: crystal with vb.net package Pin
Jayesh Talsaniya18-Jul-07 2:15
Jayesh Talsaniya18-Jul-07 2:15 
AnswerRe: crystal with vb.net package Pin
Naji El Kotob18-Jul-07 0:38
Naji El Kotob18-Jul-07 0:38 
Questionsave time Pin
saraswathy14317-Jul-07 20:44
saraswathy14317-Jul-07 20:44 
AnswerRe: save time Pin
The ANZAC17-Jul-07 21:01
The ANZAC17-Jul-07 21:01 
GeneralRe: save time Pin
saraswathy14317-Jul-07 22:52
saraswathy14317-Jul-07 22:52 
QuestionHow can i blink the color of lable in the DatagridItemTemplate? Pin
Guru_yogi17-Jul-07 19:55
Guru_yogi17-Jul-07 19:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.