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

    Retrieve a Template FileName (WORD/VBA)

    I have a number of Word templates that when opened run a VB marco that presents the user with a dialog box that allows them to select the data file for a mail merge operation. At the completion of the mail merge I want to save the resulting word doc in a folder that uses the Word template filename as the folder name, the macro will supply the specific file name. For instance, if the template opened is 'Notice of Default.dot' i want to be able to save the finished merge document in C:Notice of Defaultfilename.dot
    My problem is that I cannot retrieve the template name. Activedocument.name gives me 'Document1' and not 'Notice of Default.dot'.

    Any ideas are appreciated.

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

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

    Re: Retrieve a Template FileName (WORD/VBA)

    Try Activedocument.AttachedTemplate

  4. #3
    New Lounger
    Join Date
    Jan 2002
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Retrieve a Template FileName (WORD/VBA)

    Worked like a charm. Thanks much.

Posting Permissions

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