XDocument.SaveAs Method with Property IsSaveAs = - InfoPath Dev
in

InfoPath Dev

XDocument.SaveAs Method with Property IsSaveAs =

Last post 08-22-2005 12:32 PM by Patrick Halstead. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 08-21-2005 02:20 PM

    • maor
    • Not Ranked
    • Joined on 08-21-2005
    • Germany
    • Posts 4

    XDocument.SaveAs Method with Property IsSaveAs =

    Hello.

    (this is a copy from my question in the microsoft community, but there I get no answer - but I need)

    I want so Save my form out of a js function.

    After initialize the OnSaveRequest via the "save as"-Menubutton, the
    eventObj.IsSaveAs Property (read only) is true but after initialize OnSaveRequest with
    XDocument.SaveAs("c:\test.xml") from code, the eventObj.IsSaveAs Property is
    false and the error "The form has no filename." appears.

    How can it be?

    (my form is fully trusted)
    (helpfiletext:"The IsSaveAs property returns true when the event was
    triggered by a call to the SaveAs method")

    Thanks in advance,
    Paul Degenkolbe
  • 08-21-2005 04:00 PM In reply to

    Re: XDocument.SaveAs Method with Property IsSaveAs =

    Hi Paul,
    You can't call the "SaveAs" method in the OnSaveRequest event handler, since that in turn calls the OnSaveRequest event handler causing an improper reentrancy. You should call "eventObj.PerformSaveOperation();" instead. Hope this helps.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 08-21-2005 09:19 PM In reply to

    • maor
    • Not Ranked
    • Joined on 08-21-2005
    • Germany
    • Posts 4

    Re: XDocument.SaveAs Method with Property IsSaveAs =

    sorry, I think I had to give you some more details.

    I don't call the SaveAs Method out of the PerformSaveOperation Method, I call it from a ButtonClick Event.

    Paul Degenkolbe
  • 08-22-2005 09:01 AM In reply to

    • maor
    • Not Ranked
    • Joined on 08-21-2005
    • Germany
    • Posts 4

    Re: XDocument.SaveAs Method with Property IsSaveAs =

    if somebody wants to know, here my solution.

    simply don't use the XDocument.SaveAs() and XDocument.Save methods but call the "normal" save routines from menu/file/.

    (
    objCommandBars = Application.ActiveWindow.CommandBars
    objSave = objCommandBars.FindControl(1,3)
    objSave.Control.Execute()
    )
  • 08-22-2005 12:32 PM In reply to

    Re: XDocument.SaveAs Method with Property IsSaveAs =

    Hi Paul,
    Thanks for posting your resolution!


    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.