Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    May 2009
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have Word 2003 SP3. I have a folder called Cars. Inside it is a Car template that opens a dialog box that's filled in by a user to create a document with attachments. When user clicks one or more check boxes on the form, one or more documents are inserted at the end of the template. These inserted documents reside in their subfolders inside of the Cars folder. How would you code a relative path so someone could place the Cars folder on various drives and the VBA works correctly? I know how to set a Global Const to hard code the drive and folder locations but thought it would be more flexible for the users to place the folder in their desired location. Is this possible? Folder structure below.

    Thank you for your help.
    Charlie
    charlie6067

    Folder structure:
    Cars folder
    Car.dot
    Ford subfolder
    Ford.doc

    Chevy subfolder
    Chevy.doc

    Mercury subfolder
    Mercury.doc

  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
    [quote name='charlie6067' post='774245' date='07-May-2009 22:03']These inserted documents reside in their subfolders inside of the Cars folder. How would you code a relative path so someone could place the Cars folder on various drives and the VBA works correctly?[/quote]
    Try using the path of the cars.dot template. From code running in the template, you can get this using MacroContainer.Path. Does that help?

Posting Permissions

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