none
Edit app.config from Word Project after instalation RRS feed

  • Question

  • Hi,

    I have a Word 2010  Template Project (developed in Visual Studio 2012) with an app.config.

    I generate the installation packet with the Publish and deploy in the client machines executing the Project.vsto.

    The template works ok but my problem is that I can not edit the app.config in any client becouse there is no app.config in no where. So My clients can not customice any options.

    Somebody knows some solution, please? Thanks

    Thursday, November 29, 2012 11:27 AM

Answers

  • Hi hoscarc,

    Thanks for posting in the MSDN Forum.

    First, when your add-in is working the *.config file can't be modified. There work round is create a independent application such as a Windows form application to handle the config file. You are able to put that application together with your add-in and set a ribbon button in your add-in to call this application and close Word for your goal.

    Second, you can get correct configuration name via AppDomain.CurrentDomain.SetupInformation.ConfigurationFile property in Add-in project. In this issue it might can help you. You need retrieve the files with ".config" to find out it in the application which you create to handle you configuration file, if you want to send the configuration file's path as a parameter form the add-in.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Friday, November 30, 2012 2:41 AM
    Moderator

All replies

  • Hi hoscarc,

    Thanks for posting in the MSDN Forum.

    First, when your add-in is working the *.config file can't be modified. There work round is create a independent application such as a Windows form application to handle the config file. You are able to put that application together with your add-in and set a ribbon button in your add-in to call this application and close Word for your goal.

    Second, you can get correct configuration name via AppDomain.CurrentDomain.SetupInformation.ConfigurationFile property in Add-in project. In this issue it might can help you. You need retrieve the files with ".config" to find out it in the application which you create to handle you configuration file, if you want to send the configuration file's path as a parameter form the add-in.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Friday, November 30, 2012 2:41 AM
    Moderator
  • Thanks Tom,

    finnally I created an independent .config file in the same template's directory. When the user creates or open an existing file I locate its template directory and load de .config file.

    Best regards.

     
    Saturday, January 19, 2013 6:15 PM