PC Review


Reply
Thread Tools Rate Thread

Save eMail to file with Redemption

 
 
Hunter
Guest
Posts: n/a
 
      5th Nov 2004
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
 
Reply With Quote
 
 
 
 
Dmitry Streblechenko \(MVP\)
Guest
Posts: n/a
 
      5th Nov 2004
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

"Hunter" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
Hunter
Guest
Posts: n/a
 
      7th Nov 2004
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!



"Dmitry Streblechenko \(MVP\)" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> 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
>
> "Hunter" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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

 
Reply With Quote
 
Dmitry Streblechenko \(MVP\)
Guest
Posts: n/a
 
      8th Nov 2004
I don't know, I don't really use the Outlook VBA editor...

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


"Hunter" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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!
>
>
>
> "Dmitry Streblechenko \(MVP\)" <(E-Mail Removed)> wrote in message

news:<(E-Mail Removed)>...
> > 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
> >
> > "Hunter" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Redemption - problem with Save =?Utf-8?B?TWFydGlu?= Microsoft Outlook VBA Programming 4 31st Jan 2006 10:56 AM
How to save OLE Object in Redemption? Bingo Microsoft Outlook VBA Programming 3 16th Nov 2004 08:35 PM
How To Use Redemption To Save Attachments MikeC Microsoft Outlook VBA Programming 2 26th Aug 2004 02:55 AM
Redemption Utils: Can't save follow up time Jack Harris Microsoft Outlook VBA Programming 6 18th Dec 2003 06:15 PM
Re: How save email attachment with Redemption Sue Mosher [MVP] Microsoft Outlook VBA Programming 0 22nd Jul 2003 03:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:22 PM.