Consulting

Results 1 to 5 of 5

Thread: Inserting AutoText entry from created template

  1. #1

    Inserting AutoText entry from created template

    Hi,

    I'm working with MS Word 2003. I've got a template I've taken over called OutlineFormatter. It works fine, but it reaches in to the Normal template to use an AutoText entry called "PropHeader". I've copied that same AutoText entry into the OutlineFormatter.dot template so I can keep this all self-contained, which will make it easier to distribute to users, but the modified code is erroring out.

    The current code is this:

    NormalTemplate.AutoTextEntries("PropHeader").Insert Where:=Selection.Range, RichText:=True

    I've modified it to look at the OutlineFormatter.dot template (which i confirmed via Tools>Templates and Add-Ins that it is attached), and the modified code is below, but it is returning a RunTime error message (#5941, "The requested memeber of the collection does not exist").

    ActiveDocument.AttachedTemplate.AutoTextEntries("PropHeader").Insert Where:=Selection.Range, RichText:=True

    It seems I should be able to do this. Why would this be erroring out like this? Thanks for any input and advice. Happy New Year!

    Frank

  2. #2
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    A template listed as an Add-in is NOT the AttachedTemplate.

  3. #3
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    A template listed as an Add-in is NOT the AttachedTemplate.

  4. #4
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    A template listed as an Add-in is NOT the AttachedTemplate.

  5. #5
    What would be the attached template? Basically, how can I make this all self-contained? I want to be able to distribute this template to multiple computers that users remotely access. As it stands right now, before they can use this template, they have to open a separate/special 'normal' template and copy this autotext entry (PropHeader) into their own Normal template (via the Organizer). I've tried to save it in this OutlineFormatter.dot template, but the macro stalls at this point in the code. Thanks for taking the time to consider this issue. I greatly appreciate it.

    Frank

Posting Permissions

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