vincerhodes
Programmer
I've set up an email function in an access database, The email is compiled by using VBA to write HTML code to Outlook 2002 using the built in Outlook commands.
Everything works fine so far, but I would like to include some simple VBScript to allow the user to select an option (in this case accept or decline the date/time specified) and email the response back...
The problem is that in VBA you have to write HTML continuously, enclosed in quotes. But VBScript uses a newline between code instructions, does anyone know if there is a newline character I can write into the vba code so I can write VBScript in this manner.
See below for an example of some HTML written in VBA.
****
Sub helloWorld()
dim OutApp as Object
dim OutMail as Object
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.createitem(0)
dim exampleVariable As String
exampleVariable = "<HTML><head><title><p>Hello world</p></title></head><body><p>Please select the option below and click 'send response'</p><p><SCRIPT LANGUAGE="VBScript">'Code Goes Here'</SCRIPT></body></HTML>"
OutMail.To = "first.last@somewhere.com"
OutMail.Subject = "Hello World!"
OutMail.HTMLBody = exampleVariable
OutMail.Display
Set OutMail = Nothing
End Sub
****
Please can someone let me know if this is even possible or what the alternative is.
Thanks,
J
Everything works fine so far, but I would like to include some simple VBScript to allow the user to select an option (in this case accept or decline the date/time specified) and email the response back...
The problem is that in VBA you have to write HTML continuously, enclosed in quotes. But VBScript uses a newline between code instructions, does anyone know if there is a newline character I can write into the vba code so I can write VBScript in this manner.
See below for an example of some HTML written in VBA.
****
Sub helloWorld()
dim OutApp as Object
dim OutMail as Object
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.createitem(0)
dim exampleVariable As String
exampleVariable = "<HTML><head><title><p>Hello world</p></title></head><body><p>Please select the option below and click 'send response'</p><p><SCRIPT LANGUAGE="VBScript">'Code Goes Here'</SCRIPT></body></HTML>"
OutMail.To = "first.last@somewhere.com"
OutMail.Subject = "Hello World!"
OutMail.HTMLBody = exampleVariable
OutMail.Display
Set OutMail = Nothing
End Sub
****
Please can someone let me know if this is even possible or what the alternative is.
Thanks,
J