Deleting forms from a Sharepoint Library Site

T

Tomma

Sure thing,

This is .net code....

Use this function to get the forms published url


Private Function SubmitURL() As String
Dim URL, strFID As String
URL = thisXDocument.Solution.URI


If URL.Substring(0, 4) = "http" Then
URL = URL.Substring(0, URL.LastIndexOf
("/"))
URL = URL.Substring(0, URL.LastIndexOf
("/") + 1)

'absolute path of node FID
nodeFID = getNode("//my:FID")
strFID = nodeFID.text

SubmitURL = URL & strFID & ".xml"
SubmitURL = Trim(SubmitURL)

End If

End Function

Then call this sub to delete the file
Private Sub DeleteFile()

Dim oXmlHttp As New MSXML2.XMLHTTP26Class

Dim strURL As String = SubmitURL()

oXmlHttp.open("DELETE", strURL, False)
oXmlHttp.send()

'here is the status numbers of the oXmlhttp object if you
run into trouble
'404 is not found
'204 is no content
'201 created
thisApplication.Quit(True)
End Sub
 
T

Tomma

Sure thing,

This is .net code....

Use this function to get the forms published url


Private Function SubmitURL() As String
Dim URL, strFID As String
URL = thisXDocument.Solution.URI


If URL.Substring(0, 4) = "http" Then
URL = URL.Substring(0, URL.LastIndexOf
("/"))
URL = URL.Substring(0, URL.LastIndexOf
("/") + 1)

'absolute path of node FID
nodeFID = getNode("//my:FID")
strFID = nodeFID.text

SubmitURL = URL & strFID & ".xml"
SubmitURL = Trim(SubmitURL)

End If

End Function

Then call this sub to delete the file
Private Sub DeleteFile()

Dim oXmlHttp As New MSXML2.XMLHTTP26Class

Dim strURL As String = SubmitURL()

oXmlHttp.open("DELETE", strURL, False)
oXmlHttp.send()

'here is the status numbers of the oXmlhttp object if you
run into trouble
'404 is not found
'204 is no content
'201 created
thisApplication.Quit(True)
End Sub
 
T

Tomma

Sure thing,

This is .net code....

Use this function to get the forms published url


Private Function SubmitURL() As String
Dim URL, strFID As String
URL = thisXDocument.Solution.URI


If URL.Substring(0, 4) = "http" Then
URL = URL.Substring(0, URL.LastIndexOf
("/"))
URL = URL.Substring(0, URL.LastIndexOf
("/") + 1)

'absolute path of node FID
nodeFID = getNode("//my:FID")
strFID = nodeFID.text

SubmitURL = URL & strFID & ".xml"
SubmitURL = Trim(SubmitURL)

End If

End Function

Then call this sub to delete the file
Private Sub DeleteFile()

Dim oXmlHttp As New MSXML2.XMLHTTP26Class

Dim strURL As String = SubmitURL()

oXmlHttp.open("DELETE", strURL, False)
oXmlHttp.send()

'here is the status numbers of the oXmlhttp object if you
run into trouble
'404 is not found
'204 is no content
'201 created
thisApplication.Quit(True)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top