SaveFileDialogs in InfoPath 2007 (Managed Code) - InfoPath Dev
in

InfoPath Dev

SaveFileDialogs in InfoPath 2007 (Managed Code)

Last post 10-30-2007 12:08 PM by sagrys. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 10-30-2007 12:08 PM

    • sagrys
    • Not Ranked
    • Joined on 10-30-2007
    • Posts 2

    SaveFileDialogs in InfoPath 2007 (Managed Code)

    How do one display a savefiledialog in VSTA for managed code of InfoPath 2007? I managed to do some research and added the Microsoft.Windows.Forms.dll to the

    VSTA managed code on the button click event, then return the selected file to a control on the Form, like below...

                OpenFileDialog _oDialog;
                string _pathAndFile = null;
                XPathNavigator _xpn;
                XPathNavigator _xpnPath;

                try
                {
                    _oDialog = new OpenFileDialog();
                    //_oDialog.Title = "Document Location Search";
                    //_oDialog.InitialDirectory = Convert.ToString(FormState["SharePointPortal"]);

                    if (_oDialog.ShowDialog() == DialogResult.OK)
                    {
                        _pathAndFile = _oDialog.FileName;
                        _xpn = this.MainDataSource.CreateNavigator();
                        _xpnPath = _xpn.SelectSingleNode("/my:DocumentChangeRequest/my:_frm_sec_ChangeDesc/my:_ChangeDesc_Document", this.NamespaceManager);
                        _xpnPath.SetValue(_pathAndFile);
                    }
                }
                catch (Exception ex)
                {
                    throw new ApplicationException("Error in VSTA Document Change Request: " + ex.Message.Trim());
                }
                finally
                {
                    _oDialog = null;
                    _pathAndFile = null;
                    _xpn = null;
                    _xpnPath = null;
                }

    I am having problems with Full Trust and deploying it to SharePoint. Keep on getting security issues from within

    InfoPath when the Form is opened. Is it necessary to install or apply digital certificates?

    Any help appreciated...

     

Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.