Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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)
pCmdItm.Execute

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.