Hello everybody!
I want to create a macro that copies texts from the current email in Outlook and pastes it into cells in the row of a spreadsheet, as a manual procedure is laborious and repetitive. Something that is seemingly simple, and it should be.
I wrote the code below, but I can't figure out how to assign the current email as an item in VBA, I looked around and didn't quite understand how I can do it. Also, I would like to search for the texts that are in bold and then copy the ones directly below them, assigning those to specific column cells. I have attached the images to give an example of what I need.
For now that's all, the help would be very valuable for me to start working with Outlook and I would be very grateful.
F. Ribeiro
I want to create a macro that copies texts from the current email in Outlook and pastes it into cells in the row of a spreadsheet, as a manual procedure is laborious and repetitive. Something that is seemingly simple, and it should be.
I wrote the code below, but I can't figure out how to assign the current email as an item in VBA, I looked around and didn't quite understand how I can do it. Also, I would like to search for the texts that are in bold and then copy the ones directly below them, assigning those to specific column cells. I have attached the images to give an example of what I need.
For now that's all, the help would be very valuable for me to start working with Outlook and I would be very grateful.
VBA Code:
Sub F_Ribeiro12()
Dim outApp As Outlook.Application
Dim outMapi As Outlook.MAPIFolder
Dim outMail As Outlook.MailItem
Dim outHTML As MSHTML.HTMLDocument
Dim WB As Workbook
Dim WS As Worksheet
Dim Mail As String
Dim inbox As String
Dim lastrow As Long
Set WB = Workbooks("Book1")
Set WS = Sheets("Sheet1")
WB.Activate
WS.Activate
lastrow = WS.Range("A" & Rows.Count).End(xlUp).Row
Mail = "some_mail_user@outlook.com"
inbox = "Inbox"
Set outMapi = outApp.GetNamespace("MAPI").Folders(pasta).Folders(subpasta)
Set outHTML = New MSHTML.HTMLDocument
End Sub
F. Ribeiro