Create a TextBox in an Email Body

dbay

Registered User.
Local time
Today, 15:47
Joined
Jul 15, 2007
Messages
87
I need to know if it is possible to create a TextBox in the body of an email. Currently I am using HTML for the body of my email.

I have an email that I send out for Audit Findings. I would like some large text boxes in the email so they could fill out their responses and forward back the email to me. I could then copy and paste the the information in the textboxes where I need to.
 
Hi

Not sure it's feasible but, have you searched for HTML text boxes and tried to add the code to your email body?

N
 
Hi

Not sure it's feasible but, have you searched for HTML text boxes and tried to add the code to your email body?

N

Yes, I tried that and I could not get it to work.
 
Hi

Have you tried setting up a form in outlook itself to get the correct format and then using that HTML?


Cheers

Nidge
 
Hi

Have you tried setting up a form in outlook itself to get the correct format and then using that HTML?


Cheers

Nidge

Can you view the HTML code once you build a form in Outlook? How?
 
Have you googled collecting data access ? Access can make emails with fields in them and process the response.
 
Have you googled collecting data access ? Access can make emails with fields in them and process the response.

Yes I have. You are limited to what it creates for you. I also need this to happen from a button click. I disable all ribons in my applications.
 
Yeah. But as a test you could still make such a data-collection mail and then inside Outlook do a Save As html. Then you could see in the source how textboxes are made. Unfortunately such an Outlook-html contains piles of Microsoft-specific tags, just to make it more interesting. If you really really need this, you could play with it. Otherwise, perhaps a website for collecting data would be a better bet. Or else a plain mail, with rows of

itemname: (user-input value)

This would be parsable, if users don't screw it up, and so not very reliable.

If your mails remain within your organisation network, then perhaps making an Outlook form would be a better choice.

Update: If you let Access make a suitable mail for data collection, I wonder if you could just grab the entire html and paste it into your own mails from code. The fun is of course writing code to parse it. If you export the body of an Outlook mail in a string to Acces, then it is stripped of all Microsoft-tags, and so parsable.
 
Last edited:
Yeah. But as a test you could still make such a data-collection mail and then inside Outlook do a Save As html. Then you could see in the source how textboxes are made. Unfortunately such an Outlook-html contains piles of Microsoft-specific tags, just to make it more interesting. If you really really need this, you could play with it. Otherwise, perhaps a website for collecting data would be a better bet. Or else a plain mail, with rows of

itemname: (user-input value)

This would be parsable, if users don't screw it up, and so not very reliable.

If your mails remain within your organisation network, then perhaps making an Outlook form would be a better choice.

Thank you for your reply. I will try the Save-As HTML and see what happens.
 
What is the specific issue? Your question was how to make textboxes. So if you make a template containing the desired boxes, at least you have something. So then you could learn how to make such a template yourself for each occassion, or let Access make one for you in its roundabout way, that is unless your mails differ substantially form time to time. So you could modify the template from code perhaps. Or, back at the begining, try to make a look alike in HTML from code.

Attachments have nothing to do with templates . Those you can attach to the Outlook MailItem from VBA.

For editing/parsing HTML you may need DOM - google VBA DOM
 
What is the specific issue? Your question was how to make textboxes. So if you make a template containing the desired boxes, at least you have something. So then you could learn how to make such a template yourself for each occassion, or let Access make one for you in its roundabout way, that is unless your mails differ substantially form time to time. So you could modify the template from code perhaps. Or, back at the begining, try to make a look alike in HTML from code.

Attachments have nothing to do with templates . Those you can attach to the Outlook MailItem from VBA.

For editing/parsing HTML you may need DOM - google VBA DOM

Yes, a simple TextBox in the body of the email is all I need. In the time that we have talked about this, I have created templates and tried to figure out the code behind it to create the TextBoxes. There is a lot of xml, and html code here to look at. Then the problem is converting it over to what can be used in VBA in the porcedure. From what I have gathered so far it involves creating a Table in the HTML body.

This is what I have so far.

EmailSend.HTMLBody = _
"<p>" & "<font size=""3""><span style=font-weight:bold;>Audit: </span>" & ![TXT_Audit_Number] & " <span style=font-weight:bold;>Finding: </span>" & ![TXT_Finding_Number] & "</p>" _
& "<span style=font-weight:bold;>Response Due Date : </span>" & ![TXT_Response_Due_Date] & "<br />" _
& "<br />" _
& "<span style=font-weight:bold;>Area : </span>" & ![TXT_Area] & "<br />" _
& "<br />" _
& "<span style=font-weight:bold;>Non Conformance : </span>" & ![TXT_Conformance] & "<br />" _
& "<br />" _
& "<span style=font-weight:bold;>Potential Impact : </span>" & ![TXT_Potential] & "<br />" _
& "<br />" _
& "<span style=font-weight:bold;>Non Conformance Extension : </span>" & ![TXT_Extension] & "<br />" _
& "<br />" _
& "<br />" _
& "<br />" _
& "<br />" _
& "<font size=""4"">Please complete and return the attached Response Excel Sheet before the due date.<br />" _
& "<FORM METHOD=post NAME=Form3 >" _
& "<TABLE BORDER=""2"" CELLPADDING=""2"" CELLSPACING=""4"" WIDTH=""820"">" _
& "</TABLE>" _
& "</FORM>" _
 
Okay. So you are there, that is, if Outlook eats that. Stuff like ![TXT_Area] probably then needs to be replaced by HTML code for the suitable HTML-element.
 
Okay. So you are there, that is, if Outlook eats that. Stuff like ![TXT_Area] probably then needs to be replaced by HTML code for the suitable HTML-element.

All the ![TXT_Area] are from a Form object. Set frm = Forms!FRM_Audit_Findings

All of that works fine. I am thinking that maybe it is not realy possible to "insert" a textbox in a traditional format from VBA-HTML code. The textbox is actualy there, but does not look like a traditional textbox. Just looks like two brackets [ ]. I will continue to see what I can do. If I figure something out I will post the code back here.

Thank you for all you help
 
Okie, please do come back with the results. I guess they could be useful for many ppl here. And I am curious as to whether my ramblings fit reality or not :)
 

Users who are viewing this thread

Back
Top Bottom