BrennaBoy1
05-14-2015, 03:18 AM
Hi,
I am working on a Userform in an Excel Automation project where once the user clicks a button, it creates and displays an E-Mail.
I want to mark a cell in Excel as "Sent" if the user actually clicks the send button on the E-Mail or "Not Sent" if they just close it.
I did some research and found some code to use on a forum, but I am getting error messages.
I have attached a doc file with the code I found on the web with my code beneath that.
I am getting an error message with the line: "Public WithEvents itm As Outlook.MailItem"
The forum post I got the code from mentions, "With the added note that it requires the Outlook library reference to run, works well."
I am not sure what this means. My VBA learning is coming along, but this is the first time I have encountered Classes as such and I do not understand them at the moment - so trying to learn.
Can anyone provide guidance or suggestions?
Thanks,
B.
I am working on a Userform in an Excel Automation project where once the user clicks a button, it creates and displays an E-Mail.
I want to mark a cell in Excel as "Sent" if the user actually clicks the send button on the E-Mail or "Not Sent" if they just close it.
I did some research and found some code to use on a forum, but I am getting error messages.
I have attached a doc file with the code I found on the web with my code beneath that.
I am getting an error message with the line: "Public WithEvents itm As Outlook.MailItem"
The forum post I got the code from mentions, "With the added note that it requires the Outlook library reference to run, works well."
I am not sure what this means. My VBA learning is coming along, but this is the first time I have encountered Classes as such and I do not understand them at the moment - so trying to learn.
Can anyone provide guidance or suggestions?
Thanks,
B.