After having an Outlook nightmare, yesterday, I thought I should explain the significance of where this example VBA macro needs to exist in Outlook's VBA environment, in order for it to work.
As a result of a corruption that arose in my OST file, I was unfortunate enough to need to remove and...
I bumped into another bug in the above VBA macro today. It turned out that opening anything other than an email would produce the runtime error:
run time error 438 - object doesnt support this property or method
I discovered the problem was down to the following line:
I encountered a bug in the above macro, today. Upon opening an unfinished email from either 'Drafts' folder, within the special 'Send Accounts' that I use, the macro would crash with the following error:
Run-time error '91'
Object variable or With block variable not set
Below is the line that...
I have just completed a VBA macro, which intercepts all new emails I create or replies I generate from received emails (regardless of whether Reply, Reply-All or Forward has been clicked). The macro conditionally changes the default From Account to a different value and also adds a BCC address...
If you are using Outlook.com as the IMAP mail server, or a similar service, I would suggest that these two folders are part of the server's functionality and are therefore protected from deletion.
I may stand to be corrected, but that would be my guess.
Hi again Diane,
Having dropped your example macro into my Outlook environment, I'm pleased to confirm that it appears to be working great with my IMAP Outlook.com accounts and for successive new emails, replies, reply-alls and forwards!
Once I've got my end result working as intended, I'll...
Many thanks Diane, I'm very grateful to you!
I'll play around with the macro you've provided above and see if I can get it working on my machine. As long as it does, I'm fairly confident I can move the rest of my macro code into it and I should then have the finished, working article!
I've put a macro together from examples I found on the web, which uses the Inspectors.NewInspector event to run code when a new item window opens, whether New, Reply, ReplyAll or Forward. Amongst other things, the macro conditionally changes the value in the 'From' drop-down list, using...
Perseverance finally paid off!
If InStr(LCase(objMail.SendUsingAccount), "email@example.com") Then
After eventually stumbling on the correct search terms to use in my browser, it led me to another post on the web that shows you how to prompt a user as to whether or not they've...
Whilst I've had a certain degree of success in using the MailItem.SendUsingAccount property to set the Outlook account through which I want to send an email, I've hit a brick wall in my attempts to use the MailItem.SendUsingAccount property to retreive this value from the current, open...
Brilliant, it works! Makes me wonder why that '.Class' was in the original example, but I guess it could just have been a typo.
Anyway, many thanks indeed for your help, I can now get on with trying to acheive the primary objective!
I'm afraid I'm no developer, but I'm trying to cobble together a small automation solution in Outlook for myself, using some example code I found on the web (which originated from Sue Mosher), but I'm afraid I've stumbled at the very first hurdle.
I want to get Outlook to 'do something'...