Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    finding the current user (2000/SR2)

    I have word documents that I send to co-workers who also have the same templates on their PC. The templates are kept in a sub folder under the user template folder. These docs have a custom property that tells the name of the word template it was derived from. I am looking for the code that I would use that will give me the user template path for the current logged in user so that I will be able to attach the template.

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

    Re: finding the current user (2000/SR2)

    From Word VBA help:

    Dim strPath As String
    strPath = Options.DefaultFilePath(wdUserTemplatesPath)

  3. #3
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: finding the current user (2000/SR2)

    Thank you!

  4. #4
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: finding the current user (2000/SR2)

    Jim,

    Hans has pointed you to a solution for finding the User Templates path for each individual user so that you can attach the appropriate template, but if you are setting up templates for your co-workers, you shouldn't even have to go to the trouble of attaching the template each time.

    If you are all working on a network, place the templates in a shared network directory; have each user point their Tools > Options > File Locations > Workgroup Templates setting to point to this location. With the template in one unified location, all new documents created from the template will have the same 'template path' setting; therefore the template will always be attached when users re-open an existing document, even if it was created by a different user.

    Even if your co-workers are on disparate, non-networked PCs, you can still achieve this same effect. For example, you could instruct all of them to set up a folder called C:Firm Templates on their individual PCs. When you distribute the templates, instruct the users to install them to this location. As in the previous paragraph, you also have the users point their File Locations > Workgroup Templates setting to this location.

    In either one of the two above scenarios, all of your co-workers should be able to share documents without having to worry about attaching the template; the template will always be attached due to the standardized location.

    Gary

  5. #5
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: finding the current user (2000/SR2)

    Thank you. I know about the Workgroup templates area but the requirements call for not using that area. In addition the requirements call for using sub folders under the User template area and Word does not search in sub folders when trying to locate a template to attach to, so that is why I researching the other method.

Posting Permissions

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