Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / November 2004

Tip: Looking for answers? Try searching our database.

Save eMail to file with Redemption

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hunter - 05 Nov 2004 18:28 GMT
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
Dmitry Streblechenko \(MVP\) - 05 Nov 2004 19:28 GMT
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

> Hello fellow corders,
>
[quoted text clipped - 19 lines]
>
> End Sub
Hunter - 07 Nov 2004 18:57 GMT
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!

> Change the line
> Print #1, onMailItem.Body.Item;   ' ERROR here!
[quoted text clipped - 29 lines]
> >
> > End Sub
Dmitry Streblechenko \(MVP\) - 08 Nov 2004 17:37 GMT
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

> Thank you Dmitry,
>
[quoted text clipped - 49 lines]
> > >
> > > End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.