Results 1 to 2 of 2

Thread: Insert text from an excel file into a word document (Word VBA)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Insert text from an excel file into a word document (Word VBA)

    Since my documents usually have certain phrases that can be used over and over again, I want to hotkey them all to save time. To be more specific, I plan to make, let say, Macro1 (insert "Of course"), Macro2 (insert "The issue is"), and Macro3 (insert "by the time"), hotkeyed to Alt +1,2,3 respectively. If I press Alt + 2, "The issue is" got inserted instantly at my cusor.

    Here's the base macro I'm using:

    Sub Macro1()
            Selection.TypeText Text:="sample text"
        End Sub
    The problem is for any new document, the content of Macro1, 2, and 3 will often need to be changed. I plan on creating an excel file to house all the phrases for ease of edit, but don't know how to link its specific cells back to the word macros. Is there a way to do that?

    Note: I'm aware of the AutoText or Building Block function in word, but I don't find them as easy to edit as an excel table.
    Last edited by vkhu; 11-25-2017 at 07:41 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •