Tuesday, June 24, 2008

Create a Save As dialog box in InfoPath

Just pop the following code into your VSTO project for the button click event.

FileDialog oDialog = new SaveFileDialog();
oDialog.DefaultExt = "xml";
oDialog.Filter = "InfoPath Form (*.xml)*.xml";
if(oDialog.ShowDialog() == DialogResult.OK)
{
string sFilename = oDialog.FileName;
this.SaveAs(sFilename);
}

1 comment:

Amelia said...

I will definitely try this code in my current project. The code posted above seems to me working but to make it sure I need to run it. Thanks for posting it.
infopath