Want to edit the Places Bar of Save As dialog box of MS office.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akbbhatt
    New Member
    • Aug 2008
    • 5

    Want to edit the Places Bar of Save As dialog box of MS office.

    I am trying to open up a "Save As dialog box" in word using c#. I can open the dialog box fine, but i need to modify the Places Bar. I want to remove everything except My Network Places from the Places Bar. anybody please help me out.

    thank you.
  • akbbhatt
    New Member
    • Aug 2008
    • 5

    #2
    please help me guys...

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      This requires using win32_api, I remember seeing how it was done once, but not where or how.
      I would try in either the c/c++ or windows forum.

      Comment

      • DonBytes
        New Member
        • Aug 2008
        • 25

        #4
        Can't really help you with your problem but I just recently did this for the normal Save As dialog box (the one Notepad etc use) and the way I ended up doing it was by the Registry. Here's an export of the keys:

        Code:
        Windows Registry Editor Version 5.00
        
        [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\comdlg32\PlacesBar]
        "Place0"=dword:00000000
        "Place1"=dword:00000011
        "Place2"=dword:00000005
        "Place3"=dword:00000012
        "Place4"="\\\\Sicilly\\d$"
        Might at least help get you in one possible direction. By the way this key can also be done in LOCAL_MACHINE iirc.

        Comment

        • akbbhatt
          New Member
          • Aug 2008
          • 5

          #5
          I am trying to open up a "Save As dialog box" in word using c#. I can open the dialog box fine, but i need to modify the Places Bar. I want to remove everything except My Network Places from the Places Bar. anybody please help me out.



          Microsoft.Offic e.Interop.Word. Application wordap = applicationObje ct as Microsoft.Offic e.Interop.Word. Application;


          Microsoft.Offic e.Interop.Word. Dialog oDlg = wordap.Dialogs[Microsoft.Offic e.Interop.Word. WdWordDialog.wd DialogFileSaveA s];


          object[] oArgs = new object[1];

          oArgs[0] = (object)@"test. doc";

          oDlg.GetType(). InvokeMember("N ame", BindingFlags.Se tProperty, null, oDlg, oArgs); its working for "Name" , fine.

          Here similarly if i do like- InvokeMember("P laces bar", indingFlags.Set Property, null, oDlg, oArgs);

          its not working. how can i modify the links on Places Bar???

          please help me with this.

          thanks a lot.

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            Well I can go ahead and say I doubt that a member variable would have a space in it.
            Have you checked the API on that object to see what member variables ARE there?

            Comment

            • akbbhatt
              New Member
              • Aug 2008
              • 5

              #7
              Originally posted by Plater
              Well I can go ahead and say I doubt that a member variable would have a space in it.
              Have you checked the API on that object to see what member variables ARE there?
              thanks a lot for u reply.
              I want to Publish one word document. For that, one Save as dialog box will be displayed. In Xp it will show only My Network Places in the Places Bar. But in Vista its showing all other icons like my documents, My Computer etc. Actually we are going to save the document in some server machine while Publishing, and the user is not allowed to save it in de local machine. So there is no need of Icons otherthan My Network Places.

              i understood that i can do it by changing in registry. But actually i want it only in this particular save as dialog box. It should not effect the whole exisiting application.
              So is there any other way to accomplish this.

              thanks.

              Comment

              • Plater
                Recognized Expert Expert
                • Apr 2007
                • 7872

                #8
                What Is was getting it is that
                "Places bar" doesn't sound like a valid member name
                "placesbar" or "PlacesBar" -might- be.
                So you would do this:
                InvokeMember("P lacesBar", indingFlags.Set Property, null, oDlg, oArgs);

                But what I really think is that you should go look up the ms office API for the object that oDlg is

                Comment

                Working...