How to deploy .Vsto file with the images folder RRS feed

  • Question

  • Hi all,


    I have created a vsto addin for word 2007.In this addin, I am generating the ribbon using a custom xml file present in the server. This Custom xml file i am getting from the wcf service.

    Now, In my local vsto solution explorer, i have an 'images' folder, through which i am giving images to my ribbon buttons.(I am  dynamically loading the ribbon using the custom xml file in the server and images folder in my solution explorer.)

      I am using the following path to get the "images" folder in my solution explorer.

                          string path = AppDomain.CurrentDomain.BaseDirectory;

                           string[] pathArray = path.Split(new char[] {'\\'});
                           path = string.Empty;
                            for (int temp = 0; temp < pathArray.Count() - 3; temp++)
                                if (temp == 0)
                                    path = path + pathArray[temp];
                                    path = path+ "\\" + pathArray[temp];


                 Now, when i am installing the .vsto file in other system, it is searching the 'images' folder in documents and settings and showing the error mesage" c:\\Documents& Settings\\images\\refresh.gif".


    Even i tried with the following paths,it is searching the 'images' folder in following paths:

    string path = Application.startupPath------> looking for 'images' folder in Program files.

    string path = Application.ExecutablePath---------> looking for 'images' folder in Office Folder

    string path = Environment.CurrentDirectory--------> looking for 'images' folder in c:\\Documents & settings.


    How can i  give dynamic images with my .vsto file or is there any other path for giving my solution explorer's image folder.


    Any help will be greatly appreciated.



    KSR Prasad.




    Thursday, April 28, 2011 6:00 AM