marissela7
New member
- Local time
- Today, 13:10
- Joined
- Jul 31, 2018
- Messages
- 3
Hi all! I hope you're well
I'm having three problems here.
Problem 1
I have a form that I use to send emails as a part of it, I added the CC and BCC field and it stopped working and now shows the "Run-time error 94: Invalid use of null" , I don't mind if the CC and BCC fields are blank, it is not always needed to full those fields.
Problem 2:
I did this form a while back and my form has a few tabs, the one with the "mailer tool" shows by default on the "To" field the email that I entered on my first tab with "General information" where the source is another table.
Any thoughts on how to do this again? I can't remember how i did this.
Problem 3:
I need to have a msgbox with the vbYesNo option and then have the email sent if the response is yes and after that a msgbox with a confirmation if email was sent but somehow i cant get that done..
Here is the code:
Dim oapp As New Outlook.Application
Dim oemail As Outlook.MailItem
Set oemail = oapp.CreateItem(olMailItem)
oemail.SentOnBehalfOfName = Me.From
oemail.To = Me.To
oemail.CC = Me.CC
oemail.BCC = Me.BCC
oemail.Subject = Me.Subject
oemail.HTMLBody = Me.Body
oemail.Send
msgbox "Email sent!"
Any thoughts?
I'm having three problems here.
Problem 1
I have a form that I use to send emails as a part of it, I added the CC and BCC field and it stopped working and now shows the "Run-time error 94: Invalid use of null" , I don't mind if the CC and BCC fields are blank, it is not always needed to full those fields.
Problem 2:
I did this form a while back and my form has a few tabs, the one with the "mailer tool" shows by default on the "To" field the email that I entered on my first tab with "General information" where the source is another table.
Any thoughts on how to do this again? I can't remember how i did this.
Problem 3:
I need to have a msgbox with the vbYesNo option and then have the email sent if the response is yes and after that a msgbox with a confirmation if email was sent but somehow i cant get that done..
Here is the code:
Dim oapp As New Outlook.Application
Dim oemail As Outlook.MailItem
Set oemail = oapp.CreateItem(olMailItem)
oemail.SentOnBehalfOfName = Me.From
oemail.To = Me.To
oemail.CC = Me.CC
oemail.BCC = Me.BCC
oemail.Subject = Me.Subject
oemail.HTMLBody = Me.Body
oemail.Send
msgbox "Email sent!"
Any thoughts?