.msg Attment Access to Body Text

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to access the actual Body text of a .msg attachment without
saving and accessing as a file?

I have an email management app that overlays outlook and I want to be able
to include the .msg text within the management console (Body) of an email.

Thanks so much!
Ed
 
Am Mon, 12 Dec 2005 14:29:02 -0800 schrieb emanson:

Ed, with the Outlook object model there´s no way but you can use Redemption
(www.dimastr.com) and access the Attachment.AsText function.
 
Thanks Michael! I added the following code which isnt the best solution but
it works... I append MyLineAll to the body portion of my app. I hate Gotos
and will clean up later. "SaveDirectory" And "AttachmentExtString" are table
values. Thanks again for you help.

Ed

If InStr(1, AttachmentExtString, Trim(Right(Attachment.FileName, 4))) > 0
Then
retval = Dir$(SaveDirectory & Attachment.FileName)
On Error GoTo FileNotPresent:
If retval <> "" Then
SetAttr SaveDirectory & Attachment.FileName, vbNormal
Kill SaveDirectory & Attachment.FileName
End If

FileNotPresent:
Attachment.SaveAsFile SaveDirectory & Attachment.FileName
Open SaveDirectory & Attachment.FileName For Input As #1
Do While Not EOF(1)
Line Input #1, MyLine

MyLineAll = MyLineAll & vbCrLf & MyLine
Loop
Close #1
On Error GoTo FileNotPresent:
SetAttr SaveDirectory & Attachment.FileName, vbNormal
Kill SaveDirectory & Attachment.FileName

End If
 
Back
Top