Hi all,
following on from a thread yesterday i need further assisance.
If i get a question asking do you want to send email and the response is "yes", i want outlook to display a mail however if it's "no" then i want it to end (as per code below, it's the last question):
Excel 2010 - to be backwards compatible to 2007
Thanks in advance for your expertise.
Darren
following on from a thread yesterday i need further assisance.
If i get a question asking do you want to send email and the response is "yes", i want outlook to display a mail however if it's "no" then i want it to end (as per code below, it's the last question):
Excel 2010 - to be backwards compatible to 2007
Rich (BB code):
q9 = InputBox("Q9: Do you want to activate messaging?", "msg", "Yes/No")
Worksheets("Response").Cells(Range("msg").Row, Range("msg").Column).Value = q9
If q9 = "no" Then
q10 = InputBox("Q10: Do you want to send the email?", "email", "Yes/No")
Worksheets("Response").Cells(Range("email").Row, Range("email").Column).Value = q10
End If
If q10 = "yes" Then
Email_Subject = "Test"
Email_Send_From = "darren@isp.com"
Email_Send_To = "testacct1@isp.com"
Email_Bcc = "testacct2@isp.com"
Email_Body = "Hello - " & vbCr & vbCr & "This is a test." & vbCr & vbCr & "Thanks," & vbCr & vbCr & "darren"
Set Mail_Object = CreateObject("Outlook.Application")
Set Mail_Single = Mail_Object.CreateItem(0)
With Mail_Single
.Subject = Email_Subject
.To = Email_Send_To
.cc = Email_Cc
.BCC = Email_Bcc
.Body = Email_Body
.display
End If
If q9 = "yes" Then
Dim ie As Object
Set ie = CreateObject("INTERNETEXPLORER.APPLICATION")
ie.NAVIGATE "http://website.com/"
ie.Visible = True
While ie.busy
DoEvents
Wend
q10 = InputBox("Q10: Do you want to send the email?", "email", "Yes/No")
Worksheets("Response").Cells(Range("email").Row, Range("email").Column).Value = q10
End If
Sheets("Response").Select
End Sub
Thanks in advance for your expertise.
Darren
Last edited: