Can anyone show me how to get html from Notes inbox messages in VBA?
I am using Access VBA to send notes email messages. The message is a form I'm asking the recipient to fill out and return. The message contains html with <select> and <input> elements. The replies come back and in Lotus Notes, I am able to read what option the sender selected and any text they may have entered. In VBA code, I am able to loop thru the inbox messages and get the message, however I am only able to get the plain text. With plain text, I am able to get the text that was entered into a textbox element but I am not able to get anything from a dropdown select element.
Here is some code that is working:
Dim session As Object
Dim mailDb As Object
Dim view As Object
Dim doc As Object
Dim MailServer As String
Dim MailDbPath As String
MailServer = "myMailServer"
MailDbPath = "myDBPath"
Dim i As Integer
Set session = CreateObject("Notes.NotesSession")
Set mailDb = session.GETDATABASE(MailServer, MailDbPath$)
If mailDb.isOpen = False Then mailDb.OPENMAIL
Set view = mailDb.GetView("ReplyFolder")
Set doc = view.GetFirstDocument
Do While Not (doc Is Nothing)
Dim thisSubject As String
Dim thisFrom As String
Dim thisDate As Date
Dim thisbody As String
thisDate = doc.Created
If doc.GetItemValue("Form")(0) = "Reply" Then
thisSubject = doc.GetItemValue("Subject")(0)
If InStr(1, thisSubject, "*** RESPONSE REQUIRED ***") > 0 Then
thisFrom = doc.GetItemValue("From")(0)
thisbody = doc.GetItemValue("Body")(0)'<<< This is the plain-text body of the message.
' html tags are stripped out.
' I get text from <input type='text'> elements
' I do not get text from <select> elements
Set doc = view.GetNextDocument(doc)
i = i + 1
If i > 1000 Then Exit Do
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!