<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SharePoint Integration</title><link>https://www.infopathdev.com:443/forums/46.aspx</link><description> For questions concerning issues in the integration of SharePoint and Microsoft InfoPath.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Open form from library 1, change, submit to library 2, delete from library 1</title><link>https://www.infopathdev.com:443/forums/thread/36498.aspx</link><pubDate>Fri, 02 Jan 2009 13:41:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36498</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36498.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=36498</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;After closing the form you are trying to delete the old file. Can you change close the form code&amp;nbsp;after deleting the old file then it will work. &lt;/p&gt;
&lt;p&gt;Whenever you are trying to in one function create and another function try to delete it won&amp;#39;t accept right. If you want to do this operation one after another, you have to use msxml2 object for both operation. It will give error If you try to create another object without closing the existing connection.&lt;/p&gt;</description></item><item><title>Re: Open form from library 1, change, submit to library 2, delete from library 1</title><link>https://www.infopathdev.com:443/forums/thread/36495.aspx</link><pubDate>Fri, 02 Jan 2009 11:40:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36495</guid><dc:creator>Quengles</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36495.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=36495</wfw:commentRss><description>&lt;p&gt;It still fails. I don&amp;#39;t understand why when I comment out the &amp;quot;if submitxmldoc(strUrl) then&amp;quot; and &amp;quot;end if&amp;quot; that it deletes the file without a problem. Its seems as if the msxml2 is failing when I use it twice in succession. The&amp;nbsp;submit and delete functions work fine independently, but when run together it gives me the access denied error. Do I have to clear out the msxml2 object some how before using it again?&lt;/p&gt;</description></item><item><title>Re: Open form from library 1, change, submit to library 2, delete from library 1</title><link>https://www.infopathdev.com:443/forums/thread/36493.aspx</link><pubDate>Fri, 02 Jan 2009 05:22:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36493</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36493.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=36493</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Once replace the code line where you are getting error with the following.&lt;/p&gt;
&lt;p&gt;objXmlHttp.open(&amp;quot;DELETE&amp;quot;, strurl, False, UserName, PWD)&lt;/p&gt;</description></item><item><title>Open form from library 1, change, submit to library 2, delete from library 1</title><link>https://www.infopathdev.com:443/forums/thread/36489.aspx</link><pubDate>Thu, 01 Jan 2009 15:10:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36489</guid><dc:creator>Quengles</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36489.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=36489</wfw:commentRss><description>&lt;p&gt;The form I&amp;#39;m working with is a timesheet. The employee submits it to a &amp;quot;supervisor&amp;quot; library. The supervisor will open the form, digitally sign it, then submit it to a &amp;quot;payroll&amp;quot; library. At this point I need the copy in&amp;nbsp;the supervisor library to be deleted.&amp;nbsp;The problem I have is it returns &amp;quot;Access is denied&amp;quot;. I think the problem is the form has not completely closed by the time the delete is called and it thinks the file is still in use. I know the code works because if I tell it to delete a file I&amp;#39;m not currently in it works fine. It will even fail if I change &amp;quot;DELETE&amp;quot; to &amp;quot;GET&amp;quot;. I have checked the path that is being passed and I have checked permissions. Maybe someone can tell me where I&amp;#39;ve gone wrong. What&amp;#39;s really strange is if I skip the submit and go straight to the delete it works fine! I&amp;#39;m using 2003. Here&amp;#39;s the functions I have:&lt;/p&gt;&lt;pre&gt;private sub DeleteXmlDoc(strUrl)
    &amp;#39; Create the XMLHTTP object
    dim objXmlHttp
    set objXmlHttp = CreateObject(&amp;quot;MSXML2.XMLHTTP.5.0&amp;quot;)

    &amp;#39; ######## THIS IS WHERE IT FAILS #########
    objXmlHttp.Open &amp;quot;DELETE&amp;quot;, strUrl, false
    objXmlHttp.send

    set objXmlHttp = nothing
end sub

private function SubmitXmlDoc(strUrl)
    dim fFileExists
    fFileExists = false

    dim blnSubmitSuccess
    blnSubmitSuccess = false

    &amp;#39; Create an XMLHTTP object to transport the file.
    dim objXmlHttp
    set objXmlHttp = CreateObject(&amp;quot;MSXML2.XMLHTTP.5.0&amp;quot;)

    &amp;#39; Attempt to open to the form location to check if a form with the same name already exists
    objXmlHttp.Open &amp;quot;GET&amp;quot;, strUrl, false
    objXmlHttp.Send
    
    &amp;#39; Status 200 or 201 = file exists
    &amp;#39; This should never happen because the file name is time stamped to be unique
    if objXmlHttp.status = 200 or objXmlHttp.status = 201 then
        fFileExists = true
        XDocument.UI.Alert(&amp;quot;Submit failed. The file already exists.&amp;quot;)
    end if
 
    &amp;#39; If no form at the same URL has been found, proceed to submit.
    if objXmlHttp.Status = 404 or not fFileExists then
        &amp;#39;Submit the form to the form library. 
        objXmlHttp.Open &amp;quot;PUT&amp;quot;, strUrl, false
        objXmlHttp.Send XDocument.DOM.xml
  
        &amp;#39; Status codes of 200 or 201 indicate that the form
        &amp;#39; has been submitted successfully.
        if objXmlHttp.Status = 200 or objXmlHttp.Status = 201 then
            blnSubmitSuccess = true
        end if
    end if

    set objXmlHttp = nothing

    SubmitXmlDoc = blnSubmitSuccess
end function

private sub CTRL445_5_OnClick(eventObj)
    dim strUrl
    strUrl = &amp;quot;http://mysharepointsite/formlibrary/formname.xml&amp;quot;

    &amp;#39; Try the submit
    if submitxmldoc(strUrl) then
        dim curDocUrl
        curDocUrl = XDocument.URI
 
        &amp;#39; Close the file
        XDocument.View.Window.Close(true)
  
        &amp;#39; Delete the old file
        DeleteXmlDoc(curDocUrl)
    end if
end sub
&lt;/pre&gt;</description></item></channel></rss>