Macro Intro
You are in the zone typing away suddenly work comes to a screeching halt because you can’t remember how to type the next part. The Word Quick Text macro was designed so you can be more efficient and get back on track. Running this macro will display an InputBox giving you an opportunity to recall specific information from within the VBA code. Make your selection by entering the leading number and watch the text populate at the current location of your cursor. The Quick Text macro helps you quickly enter text that you use on a frequent basis. This Word macro can also be used to recall text that you don’t use often. VBA helps you store and access information allowing you free up the memory between your ears. You can spend time typing and studying flash cards for memorization. A better idea would be to start using the Word Quick Text macro today!See it in Action
Watch this video to see this macro in action.Code
Here is the code for this macro. Make sure the following References are setup before running it: Visual Basic For Applications, Microsoft Word 16.0 Object LibraryInsider Content
Here is the Insider code for this macro. This code will allow you to setup an Excel Workbook to manage the Quick Text you want to quickly populate into your Word Document! Make sure the following References are setup before running it: Visual Basic For Applications, Microsoft Word 16.0 Object Library, Microsoft Excel 16.0 Object LibraryCustomization
These segments of code can be customized to personalize this macro.When the Word Quick Text macro runs it immediately displays a InputBox with the current Quick Text options defined in the Options variable. If you want more Quick Text options add more in the Options variable by copying the last entry. COPY & vbNewLine & _ “4. Quick Text #4” PASTE then update 4. with 5. and change Label Quick Text #4 to something more descriptive.
Using the Options variable and InputBox displays the Quick Text to choose from. If you want to change the InputBox Header update “Word Quick Text” in this code line.
When an Action is determined the Word Quick Text macro with walk through a ElseIf Statement looking for the Quick Text associated with the Action. If you want more Quick Text options add more in the ElseIf Statement. To this you can COPY ElseIf Action = “4” Then
QuickText = “Quick Text #4” PASTE then update “4” with “5” and change “Quick Text #4” to what you want to populate into the Word Document.
If an Option is entered but isn’t found this MsgBox will display. This can be helpful if you know you typed a value the macro confirms if it is recognized. If you don’t want to see this MsgBox remove it or make this code line a comment.
With an Action indicated and a Quick Text selected the Word Quick Text macro will now populate the Word Document where the cursor is located. If you want to change the finishing behavior of what this macro does with the Quick Text here is where you would do that.