I'd like to assign a macro in Outlook 2007 to a Toolbar button that would execute the equivalent of these clicks when there is formatted text in the Windows clipboard:
- Click the Paste icon by the bottom arrow
- Click the Paste Special link.
- Click the Unformatted Text link.
I have similar macros in Excel 2007 and Word 2007 but haven't been able to get one to work in Outlook 2007 / VBA. What would the VBA code for such a macro be?
Best Answer
With lots of help from author Sue Mosher, I have finally managed to get a macro working on Outlook 2007 to automate the mouse clicks of Paste – Paste Special – Unformatted Text! WOO-HOO!!!!
Most of what I cut and paste into Outlook email messages is formatted. Pasting with CTRL-V or by clicking the Paste button keeps that formatting intact. Clicking Paste – Paste Special – Unformatted Text isn’t a big deal, but it takes a couple of seconds every time I do it – and I do it a LOT. So this little thing will be a timesaver for me.
The VBA subroutine:
To get it to work, I also needed to open the VBA editor in Outlook 2007, click Tools – References, and enable the reference for Microsoft Word 12.0 Object Library. I then linked the macro to a custom button in the QAT toolbars for creating new messages and replies and it worked just fine!
I may have mentioned this before, but WOO-HOO!!!!
Thank you, Sue!