![]() |
Keyboard Shortcut - Set Font Size in MS Word - Printable Version +- Cedeq Community Forum (https://cedeq.com/forums) +-- Forum: General (https://cedeq.com/forums/forumdisplay.php?fid=1) +--- Forum: Keyboard shortcuts with AutoHotkey code (https://cedeq.com/forums/forumdisplay.php?fid=4) +--- Thread: Keyboard Shortcut - Set Font Size in MS Word (/showthread.php?tid=16) |
Keyboard Shortcut - Set Font Size in MS Word - denilama - 03-01-2018 With AutoHotkey you can easily set properties in Microsoft Word (e.g., font size, font name, font style, font color, line spacing, etc.). The following script is designed to set font size. By adapting this script, you can set any property you want in Word using AutoHotkey. Need help creating a keyboard shortcut with ShortKeeper using the following AutoHotkey code? This 5-minute tutorial will help! Critical You can replace line 7 in the above script with any of the following command lines to set these properties. Set font name to Arial Black: WordApp.Selection.Font.Name := "Arial Black"Set font style to italic: WordApp.Selection.Font.Italic := 1Set font style to bold: WordApp.Selection.Font.Bold := 1Unset bold font style: WordApp.Selection.Font.Bold := 0Set font color to red: WordApp.Selection.Font.Color := 0xFF0000Set line spacing to 10.5: WordApp.Selection.ParagraphFormat.LineSpacing := 10.5 The script will set the font color if the Word document is the active window and is not busy (e.g. selecting a command). If you want to set any other property in Word but don’t know how, the Word macro recorder can help. Start the macro recorder, set the property manually, and then view the resulting macro. This will give you an idea of how to do it with AutoHotkey. This script is optimized to be used with ShortKeeper. As such, there is no exception handling, no “Return” at the end, and variable(s) don’t need to be cleared. ShortKeeper does all of this automatically. Just copy/paste the code in the PARAM field in ShortKeeper, set your hotkey, save, and you’re ready to use your new keyboard shortcut. |