Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Nov 2002
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SetAttachedTemplate (W2000 9.0 3821 SR-1)

    Hello:
    I am calling SetAttachedTemplate() when using Word as a COM inside a container. The idea is that I would be able to "attach" my customized template to any documents that are open without user interference. Works OK in my W2000 version (see above) and Word XP but doesn't in other W2000 versions. Anybody has any ideas why this is happening?
    Thanks,
    Mihail

  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: SetAttachedTemplate (W2000 9.0 3821 SR-1)

    I am having trouble picturing your scenario. What kind of container are you talking about?

    Also, as far as I know, there is no native method in the Word object model called SetAttachedTemplate(). (It's not listed in the online help as an old WordBasic command, either.) Is it a DDE command? A subprocedure in a global template?

    Try this way, it should work:

    oDocument.AttachedTemplate = filespec

    Hope this helps.

  3. #3
    New Lounger
    Join Date
    Nov 2002
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SetAttachedTemplate (W2000 9.0 3821 SR-1)

    I am talking bout automation/OLE via IDispatch. Basically I am trying to run Word from C++ in my own workspace/window via automation. SetAttachedTemplate() is one of the methods available. It is NOT a VBA function.
    I know that this forum is about VBA, I was wondering if anybody worked with Word as COM and had this problem.
    I will try to set it inside my template VBA code as you suggest it. My question is WHERE? I have an attached template so as far as I know no AutoExec() will be called.
    Thanks,
    Mihail

Posting Permissions

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