Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am quite new to ArcObjects and development, but from what I have researched I can run a command programmatically like so: [VB]

Dim pUID As New UID
Dim pCmdItem As ICommandItem
pUID.Value = "esriArcMapUI.MxFileMenuItem"
pUID.Subtype = 4 'For Save As command
Set pCmdItem = Application.Document.CommandBars.Find(pUID)

However I want to extend this example so when it executes it changes defaults to always the same folder location and filename. Is this possible with ICommandItem, or do I need another interface?

share|improve this question
Not sure but maybe the save dialog uses Environment.CurrentDirectory did you try setting that before calling Execute? – Kirk Kuykendall Jul 7 '11 at 16:26

The only way I can think of is similar to this answer (to question Force a new AddDataDialog to open at a defined directory path). In your case, you would use a different registry key though:

HKEY_CURRENT_USER\Software\ESRI\ArcMap\File Path

where File Path is the name of a string value pointing to the directory which the Save dialog uses. This method will of course not allow you to specify the actual file name, only the default directory.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.