April 2006
Beginner
1114 pages
98h 16m
English
Use the Lists Web Service GetAttachmentCollection method to retrieve an attachment from a list. The GetAttachmentCollection method returns an XML node list that contains information about each attachment for the row. The following code displays the gudgeon bitmap attached in the previous section:
Sub GetAttachment( )
' Requires web reference to SharePoint Lists.asmx
Dim lws As New clsws_Lists
Dim xn As IXMLDOMNodeList ' Requires reference to Microsoft XML
Set xn = lws.wsm_GetAttachmentCollection("Test List", "2")
ThisWorkbook.FollowHyperlink xn.Item(0).Text
End SubNotice that the returned XML node list is a collection since rows can have multiple attachments. Since the preceding example attached only one file, this sample simply retrieves the first item from the node list. The Text property of this item is the address of the attachment on the SharePoint server.
Read now
Unlock full access