Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jan 2002
    Location
    Bismarck, North Dakota, USA
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calling an AutoText entry in an Add-In (VBA for Word)

    I have created all my global macros in a template Add-In that is automatically loaded when Word is opened. In the Project Explorer they are listed under Normal (WLF).

    I am trying to call AutoText entries from the WLF Add-In versus copying them to the Normal template on each machine. When I record my keystrokes, it works and shows the follwing code:

    Application.DisplayAutoCompleteTips = True
    NormalTemplate.AutoTextEntries("MK").Insert Where:=Selection.Range, _
    RichText:=True

    However, when I insert this into my macro or form, I get an error message that says the requested member of the collection does not exist.

    I am using Word 2002 and Windows 2000.

    Could someone please explain what I am missing.

    Thank you.

    Missy Kilde

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Calling an AutoText entry in an Add-In (VBA for Word)

    Not sure why NormalTemplate got recorded. Try:

    Templates("FullPathToYourAddin.dot").AutoTextEntri es("MK").Insert Where:=Selection.Range, RichText:=True

  3. #3
    New Lounger
    Join Date
    Jan 2002
    Location
    Bismarck, North Dakota, USA
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calling an AutoText entry in an Add-In (VBA for Word)

    That solved it.

    Thank you, thank you, thank you!

Posting Permissions

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