Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jul 2003
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change document template with code (Word 2002)

    Hello everyone. I am posting this question for a member of my companies IT department. He wants to know if there is a way to change the template for all documents in a directory and subdirectories without opening each document. I said that I have seen code in this forum to do just that, but a search turns up nothing. Specifically, he only wants to edit only the server part of the path of the attached template. That is, he wants to change "ATLAS" to "CVX" for all documents in a directory and subdirectories. See the attached screen shot. Can anyone help? I will be leaving shortly for the weekend. I will check for responses today, if any, otherwise Monday. Thanks in advance.
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change document template with code (Word 2002)

    Microsoft has a COM component that lets you edit document properties without actually opening the document; the document template is one of them. You can download it from Dsofile.dll lets you edit Office document properties without Office in Visual Basic .NET 2003 and in Visual Basic .NET 2002. Despite the mention of .NET, it works in VB6 and VBA too. The download comes with demos and sample code, study this carefully to see how to use it. (Opening each document in code and changing the template would be slower, but easier to program).

  3. #3
    Lounger
    Join Date
    Jul 2003
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change document template with code (Word 2002)

    Thank you Hans. I will pass this along to the IT staff.

Posting Permissions

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