VBA Code Alternative for Switching Fonts
Macros recorded via the user interface can sometimes be glitchy. Using a direct VBA code script ensures a clean, instant transition between Preeti and an English font (like Times New Roman ). 1. Press Alt + F11 to open the VBA Editor . 2. In the left sidebar, double-click Normal > Microsoft Word Objects > ThisDocument . 3. Copy and paste the following code into the large text window: vba Sub SwitchToPreeti() Selection.Font.Name = "Preeti" Selection.Font.Size = 14 End Sub Sub SwitchToEnglish() Selection.Font.Name = "Times New Roman" Selection.Font.Size = 12 End Sub Use code with caution. 4. Press Ctrl + S to save and close the VBA window. Assigning Keyboard Shortcuts to the VBA Code: 1. Go to File > Options > Customize Ribbon . 2. At the bottom, next to Keyboard...