// pMyInterface is passed in as a parameter and represents a pointer to IManFileSaveDlg (the dialog embedded within the command) var dlg = (IManFileSaveDlg)pMyInterface; // the dialog has a NewDocument property; just cast it to IManDocument; this will be your new documentvar doc = (IManDocument)dlg.NewDocument;