![]() |
|
#2
|
|||
|
|||
|
VBA code for Word won't work in Outlook -- or in any other VBA-supported Microsoft product.
VBA comes in different "flavours." Each application has a unique object model, and for that reason, VBA for each application has to be different. I find VBA for Outlook especially difficult to understand. Hopefully you'll find code samples on the web that give hints on how to accomplish what you want to do. Another way to do this, albeit less elegant, is to use a third-party automation tool to do the heavy lifting. For example, this Macro Express script (tested only once) might get the job done by sending sequences of keys. To make this script reliable, you may need to add delays after some of the steps. Text Type (Simulate Keystrokes): <CONTROL>a // Select all Text Type (Simulate Keystrokes): <F10> // Give the Ribbon focus Text Type (Simulate Keystrokes): o // Format ribbon Text Type (Simulate Keystrokes): pg // Paragraph settings Text Type (Simulate Keystrokes): <ALT>b // Navigate to Spacing Before field Text Type (Simulate Keystrokes): 0 pt Text Type (Simulate Keystrokes): <TAB> // Navigate to Spacing After field Text Type (Simulate Keystrokes): 0 pt Text Type (Simulate Keystrokes): <ENTER> // Activate the default OK button |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Help with this Macro-Partially Working | rsrasc | Excel Programming | 10 | 09-10-2020 02:38 PM |
| Just one macro not working | Ulodesk | Word VBA | 1 | 04-01-2019 09:16 AM |
| How to move data - Macro not working | ecarter312 | Excel Programming | 1 | 08-10-2016 11:26 PM |
Fraction macro not working
|
Ulodesk | Word VBA | 1 | 07-18-2012 04:01 PM |
| Macro to open template not working | Brandi | Mail Merge | 2 | 06-24-2010 09:29 AM |