PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Save eMail to file with Redemption
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Save eMail to file with Redemption
![]() |
Save eMail to file with Redemption |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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" <thexood@hotmail.com> wrote in message news:2fd6d354.0411050928.6a91b6e9@posting.google.com... > 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 |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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\)" <dmitry@dimastr.com> wrote in message news:<eo5TEV2wEHA.2600@TK2MSFTNGP09.phx.gbl>... > 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" <thexood@hotmail.com> wrote in message > news:2fd6d354.0411050928.6a91b6e9@posting.google.com... > > 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 |
|
|
|
#4 |
|
Guest
Posts: n/a
|
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" <thexood@hotmail.com> wrote in message news:2fd6d354.0411071057.7e1dbd09@posting.google.com... > 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\)" <dmitry@dimastr.com> wrote in message news:<eo5TEV2wEHA.2600@TK2MSFTNGP09.phx.gbl>... > > 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" <thexood@hotmail.com> wrote in message > > news:2fd6d354.0411050928.6a91b6e9@posting.google.com... > > > 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 |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

