0

In my vb .net program I select an email from my Exchange server as a message in Exchange Web Services.

I am looking for a solution to print that message to a network printer. Can anyone help? Either print directly as an email from EWS or as a file.

For Each i As Item In emailitems

' search and find an email

i.Load(New PropertySet(ItemSchema.MimeContent))
Dim mc As New MimeContent
Dim fs As New FileStream("c:\temp\mail.eml", FileMode.Create)
mc = i.MimeContent
fs.Write(mc.Content, 0, mc.Content.Length)
fs.Close()
fs = Nothing

' how do I print message i or mail.eml to a network printer?

Next
Frank
  • 11
  • 2
  • Does it only need to print the email text? – kshkarin Jan 23 '21 at 22:19
  • No. It needs to print the email the way it will be printed using email software like Outlook or Mail. The software will run on the Exchange server as a VB .net Windows service. – Frank Jan 25 '21 at 07:37
  • Does this answer your question? https://stackoverflow.com/a/18722872/4000335 – kshkarin Jan 28 '21 at 09:02
  • No, but I found a workaround. I load the eml file as a Word Interop document and use the PrintOut() function. – Frank Feb 01 '21 at 08:18

0 Answers0