none
Cannot access user templates when using built in new dialog in Office 2013 RRS feed

  • Question

  • Dear All,

    I have a very simple VBA program in Word and Excel that prompts the user for a file number.  It looks up the file information in Access and then asks the user for which custom template they want to use and prefills the basic file information.  This has worked perfectly in 2007 and 2010.

    When I upgraded to 2013, the user templates are not available from the built in dialog box.

    Here is the code to display the dialog box that the user selects the template from:

    Application.Dialogs(xlDialogNew).Show

    The only tabs on here are general and spreadsheet solutions.

    I have changed the location of the default personal templates.  This does allow me to select a user template when I select new from within Excel or Word but not when I use the VBA code. 

    Any thoughts?

    Thanks in advance,

    Bryan

    Monday, February 4, 2013 4:58 PM

Answers

  • Hi Bryan

    You'd need to ask in an Excel forum about Excel's dialog box. But as far as Word goes, Dialogs(wdDialogFileNew) still brings up the same dialog box as in previous versions.

    My personal templates appear in the "General" tab, as always. The templates I see here are in the location specified under Options/Advanced/General/File locations as well as in the "My Documents\Custom Office Templates" folder. Note, however, that this is not the same sources that the "Personal" section of the Backstage "New" command is looking at. This appears to only pick up content from "Custom Office Templates".


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by BigBryster Tuesday, February 5, 2013 2:44 PM
    Tuesday, February 5, 2013 8:21 AM
    Moderator
  • Hi Cindy,

    Thanks for your reply.  I have posted in the general section because it appears to me that Word and Excel are both acting the same way.

    As you stated, Dialogs(wdDialogFileNew) in 2013 appears to behave the same as it did in 2010 and 2007.  It looks exactly like it did previously.  However, I seem to be having an issue on where 2013 is grabbing its templates location from. 

    In 2010, I was able to specify the personal template folder location under options:advanced:general:file locations as you stated.  However, I do not have that option in 2013.  In 2013, I have specified the location under options:save:default personal templates location.

    It appears that 2013 does use that location when you go into file:new.  In that case, there is a tab for Personal and it correctly points at my custom templates.  However,it does not use that location for the FileNew.Show dialog box. That must be pulled from another location.

    AHHA! AH-HA (However you spell it) I figured out my problem.  Excel 2013 does not have a File Locations setting under Options:Advanced:General.  However, Word 2013 does have this setting.  Once I changed it in Word, the FileNew.Show dialog has my template folder listed as a tab in both Word 2013 and Excel 2013.

    So, just for reference, in order to add a custom template location to Word 2013 or Excel 2013 to the FileNew.Show dialog box you must go into Word 2013 and change the file location under Options:Advanced:General:File Locations.  This cannot be done in Excel 2013, but changing it in Word 2013 also affects Excel 2013.  However, this does not affect the File:New command for Word 2013 or Excel 2013.  This setting must be changed under options:save:default personal templates location. 

    Very confusing to me, but at least it is working now. 

    Thank you again for all your help!

    Bryan

    Tuesday, February 5, 2013 2:43 PM

All replies

  • Hi BigBryster,

    Thank you for posting in the MSDN Forum.

    Could you please show me what kind of dialog box you have when you run the code in Office 2007 and Office 2010? I've tried your code on my Office 2010 and Office 2013 machines respectively, both side give me the same dialog box. It will be nice if you could show me the screenshot.

    I look forward to your reply.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, February 5, 2013 8:07 AM
    Moderator
  • Hi Bryan

    You'd need to ask in an Excel forum about Excel's dialog box. But as far as Word goes, Dialogs(wdDialogFileNew) still brings up the same dialog box as in previous versions.

    My personal templates appear in the "General" tab, as always. The templates I see here are in the location specified under Options/Advanced/General/File locations as well as in the "My Documents\Custom Office Templates" folder. Note, however, that this is not the same sources that the "Personal" section of the Backstage "New" command is looking at. This appears to only pick up content from "Custom Office Templates".


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by BigBryster Tuesday, February 5, 2013 2:44 PM
    Tuesday, February 5, 2013 8:21 AM
    Moderator
  • Hi Quist,

    I have tried posting a screen shot but the forums will not let me at this point (This is my first post)

    Hopefully, I can use a thousand words to explain better :)

    In 2010 and 2013 I also get the same dialog box when I use the DialogNew.Show command.  It is a standard new template dialog box with two tabs labeled General and Spreadsheet Solutions.  The only difference between the two is that in 2010 I also have a tab with my custom templates folder listed on it.  In 2013, I do not have that tab. 

    However, in 2013, if I go to File:New then I am presented with two tabs labeled Featured and Personal.  The Personal tab does have my custom templates listed.  This is a completely different view from the DialogNew.Show command dialog box.  I assume that this is the backstage view.

    It appears to me that office 2013 is pulling the personal template directory from the options:save:default personal templates location where I have specified F:Templates.

    In 2013, it seems that the only place to specify the personal templates location is under Options:Save:Default Personal Templates.  This location seems to be ignored by the xlDialogNew.Show command and only used by the File:New button.   I do not see any file locations options anymore under the Options:Advanced:General section as it was in 2010.

     I hope this is somewhat clear :)

    Thanks for all your help.  I appreciate your time on this issue.

    Bryan

    Tuesday, February 5, 2013 1:07 PM
  • Hi Cindy,

    Thanks for your reply.  I have posted in the general section because it appears to me that Word and Excel are both acting the same way.

    As you stated, Dialogs(wdDialogFileNew) in 2013 appears to behave the same as it did in 2010 and 2007.  It looks exactly like it did previously.  However, I seem to be having an issue on where 2013 is grabbing its templates location from. 

    In 2010, I was able to specify the personal template folder location under options:advanced:general:file locations as you stated.  However, I do not have that option in 2013.  In 2013, I have specified the location under options:save:default personal templates location.

    It appears that 2013 does use that location when you go into file:new.  In that case, there is a tab for Personal and it correctly points at my custom templates.  However,it does not use that location for the FileNew.Show dialog box. That must be pulled from another location.

    AHHA! AH-HA (However you spell it) I figured out my problem.  Excel 2013 does not have a File Locations setting under Options:Advanced:General.  However, Word 2013 does have this setting.  Once I changed it in Word, the FileNew.Show dialog has my template folder listed as a tab in both Word 2013 and Excel 2013.

    So, just for reference, in order to add a custom template location to Word 2013 or Excel 2013 to the FileNew.Show dialog box you must go into Word 2013 and change the file location under Options:Advanced:General:File Locations.  This cannot be done in Excel 2013, but changing it in Word 2013 also affects Excel 2013.  However, this does not affect the File:New command for Word 2013 or Excel 2013.  This setting must be changed under options:save:default personal templates location. 

    Very confusing to me, but at least it is working now. 

    Thank you again for all your help!

    Bryan

    Tuesday, February 5, 2013 2:43 PM
  • Hi Bryan

    Yes, definitely confusing. I suspect this is the way things will be in the future and that, at some point, the setting in Word could disappear. Word relies more on templates than Excel does, since documents remain linked to the template from which they are created. So I suppose making a change would be much more critical - and break more things - than the removal of the option in Excel.

    Thanks for the tip about  OPtions:save - I hadn't noticed that one, yet!


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, February 6, 2013 1:34 PM
    Moderator