Mail to CDO (Read Text mail file into CDO Mailmessage Object)?

C

Carlos

Hmm it should be fairly simple i guess, but im stuck big time.
Cant seem to find iDataSource anywhere.

What im trying to do is to read a textfile (mail.mai) into an CDO
Mailmessage object. So that
i can modify it from there. Ive found this sample from ms, but.. im stuck.
could anyone translate ?

Function LoadMessageFromFile(Path) 'As Message
Dim Stm
Set Stm = CreateObject("ADODB.Stream")
Stm.Charset = "ascii"
Stm.Open
Stm.LoadFromFile Path
Dim iMsg
Set iMsg = CreateObject("CDO.Message")
Dim iDsrc
Set iDsrc = iMsg.GetInterface("IDataSource")
iDsrc.OpenObject Stm, "_Stream"
Set LoadMessageFromFile = iMsg
End Function

Thanx in advance.

//Carlos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top