Hi @Marcelo Nogueira ,
Please check if the following code example helps.
Imports Microsoft.Office.Interop.Outlook
Imports Microsoft.Office.Interop.Word
Public Class MainForm
Private Sub btnSendEmail_Click(sender As Object, e As EventArgs) Handles btnSendEmail.Click
Dim outlookApp As Outlook.Application = New Outlook.Application()
Dim mailItem As Outlook.MailItem = outlookApp.CreateItem(Outlook.OlItemType.olMailItem)
mailItem.To = "recipient@example.com"
mailItem.Subject = "Subject of the email"
Dim wordApp As Word.Application = New Word.Application()
Dim doc As Word.Document = wordApp.Documents.Open("C:\path\to\your\document.docx")
mailItem.BodyFormat = Outlook.OlBodyFormat.olFormatRichText
mailItem.Body = doc.Content.Text
mailItem.Display(False)
Marshal.ReleaseComObject(doc)
Marshal.ReleaseComObject(wordApp)
Marshal.ReleaseComObject(mailItem)
Marshal.ReleaseComObject(outlookApp)
End Sub
End Class
Best Regards.
Jiachen Li
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.