Connecting Tech Pros Worldwide Help | Site Map

How To Reset/Set Any Office Application Save As Path via Interop?

  #1  
Old June 7th, 2009, 11:46 AM
Newbie
 
Join Date: Jan 2009
Posts: 7
Dear All,

I was wondering if there is a way to reset the "Save As dialog" initial path when the user clicks on Save as from the menu.

As an example, if you opened a workbook from interop (C#, VB,.....) then manually opened the excel menu and clicked save as, the path displayed is the same one where the workbook got opened, is there a way to reset that path or set it differently??

Thanks.
  #2  
Old June 8th, 2009, 05:23 PM
tlhintoq's Avatar
Moderator
 
Join Date: Mar 2008
Location: Arizona, USA
Posts: 1,690
Provided Answers: 3

re: How To Reset/Set Any Office Application Save As Path via Interop?


saveFileDialog1.InitialDirectory = "C:\\testing";
  #3  
Old June 8th, 2009, 07:16 PM
Newbie
 
Join Date: Jan 2009
Posts: 7

re: How To Reset/Set Any Office Application Save As Path via Interop?


i'm sorry, im not following, SaveFileDialog is a .Net winforms class, and your code referes to an instance of that class and setting the path there. so how it fits in here????

What i want to do is to use Microsoft.Office.Interop.Excel.dll version 12 to set the path of the "Excel 2007 save as dialog" incase if the user clicked save as, the path set earlier to be shown.
  #4  
Old June 8th, 2009, 08:11 PM
tlhintoq's Avatar
Moderator
 
Join Date: Mar 2008
Location: Arizona, USA
Posts: 1,690
Provided Answers: 3

re: How To Reset/Set Any Office Application Save As Path via Interop?


My mistake. I thought you were writing a C-Sharp program that writes Excel files programmatically. So I thought you were looking to change the InitialDirectory of a native SaveFileDialog.
Reply