Save eMail to file with Redemption

  • Thread starter Thread starter Hunter
  • Start date Start date
H

Hunter

Hello fellow corders,

I am new to VBA, redemption and outlook. :-)
I try to save an incomming message to a file so I can process it with
a C++ programm (that's the only thing I can code in).

I have Outlook 2003 and found out that I am not allowed to access the
MailItem.Body because of the latest service pack.
Therefore I am using Redemption.
With it I can dump the .Body to a message box, but not to a file!
I get an error saying "objewct required".

I would apprecitate help. Thank you!

Sub ProcessMail(objMsg As MailItem)

Set oMailItem = CreateObject("Redemption.SafeMailItem")
oMailItem.Item = objMsg
Open "D:\test.txt" For Output As #1
Print #1, onMailItem.Body.Item; ' ERROR here!
Close #1

End Sub
 
Change the line
Print #1, onMailItem.Body.Item; ' ERROR here!
to
Print #1, oMailItem.Body; ' ERROR here!

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Thank you Dmitry,

this was quite embaressing. I just mistypes the variable! I would have
supected the compiler (or pharser) tells me about it, but now it gives
me some cryptic error message. *g*

No the oddest thing happend. I changed the macro and it is no longer
working!
As if it were empty. So I created a new function, and nothing happens.
Playing around in the VBA editor I suddenly get the message that the
macros are disabeld, yet I did not change a thing.

Turns out I had to delete the whole Module, save, exit and create a
all new one for the marcro to work again. Could this be some bug?
Maybe something jet again with a new service pack?

Do you, or anyone know any work arounds for this?

Thank you!
 
Back
Top