Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicPythonRubySQL ServerSwiftTclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcel

VBScript Examples


ASN.1
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Bounced Email
Box
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
ECC
Email Object
Encryption
FTP
Facebook
Firebase
GeoOp
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
Gzip
HTML-to-XML/Text
HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)

Java KeyStore (JKS)
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
PayPal
Peoplevox
QuickBooks
REST
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Shopify
Socket/SSL/TLS
Spider
Stream
Stripe
SugarCRM
Tar Archive
Twitter
VoiceBase
Walmart
WebSocket
XML
XML Digital Signatures
XMP
Xero
Zip
curl
eBay

 

 

 

(VBScript) SharePoint -- Get Folder Properties

This example shows how to get the properties of a SharePoint folder. Specifically, it gets the properties of one of our test folders named "Briefing 02032017".

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set outFile = fso.CreateTextFile("output.txt", True)

'  This example assumes the Chilkat HTTP API to have been previously unlocked.
'  See HTTP Unlock Sample for sample code.

'  For example, imagine our SharePoint endpoint is https://xyzoffice.mycompany.com/
'  The SHAREPOINT_NTLM_DOMAIN would be "mycompany.com"
'  The SHAREPOINT_HTTPS_DOMAIN would be "xyzoffice.mycompany.com"

'  Also, the SHAREPOINT_USERNAME would be just the name, not a full email address.
'  for example, "chilkat" instead of "chilkat@mycompany.com"

set http = CreateObject("Chilkat_9_5_0.Http")

'  Provide the credentials:
http.Login = "SHAREPOINT_USERNAME"
http.Password = "SHAREPOINT_PASSWORD"
http.LoginDomain = "SHAREPOINT_NTLM_DOMAIN"
'  Tell Chilkat to use NTLM authentication.
http.NtlmAuth = 1

'  Indicate that we want a JSON reply
http.Accept = "application/json;odata=verbose"

set sbJson = CreateObject("Chilkat_9_5_0.StringBuilder")
success = http.QuickGetSb("https://SHAREPOINT_HTTPS_DOMAIN/_api/web/GetFolderByServerRelativeUrl('/Briefing 02032017')",sbJson)
If (success <> 1) Then
    outFile.WriteLine(http.LastErrorText)
    WScript.Quit
End If

set json = CreateObject("Chilkat_9_5_0.JsonObject")
success = json.LoadSb(sbJson)
json.EmitCompact = 0

'  To get the number of items in the folder:
itemCount = json.IntOf("ItemCount")
outFile.WriteLine("Number of items: " & itemCount)

'  The full JSON response looks like the following:
outFile.WriteLine(json.Emit())

'  {
'    "d": {
'      "__metadata": {
'        "id": "Web/GetFolderByServerRelativeUrl('/Briefing 02032017')",
'        "uri": "https://SHAREPOINT_HTTPS_DOMAIN/_api/Web/GetFolderByServerRelativeUrl('/Briefing%2002032017')",
'        "type": "SP.Folder"
'      },
'      "Files": {
'        "__deferred": {
'          "uri": "https://SHAREPOINT_HTTPS_DOMAIN/_api/Web/GetFolderByServerRelativeUrl('/Briefing%2002032017')/Files"
'        }
'      },
'      "ListItemAllFields": {
'        "__deferred": {
'          "uri": "https://SHAREPOINT_HTTPS_DOMAIN/_api/Web/GetFolderByServerRelativeUrl('/Briefing%2002032017')/ListItemAllFields"
'        }
'      },
'      "ParentFolder": {
'        "__deferred": {
'          "uri": "https://SHAREPOINT_HTTPS_DOMAIN/_api/Web/GetFolderByServerRelativeUrl('/Briefing%2002032017')/ParentFolder"
'        }
'      },
'      "Properties": {
'        "__deferred": {
'          "uri": "https://SHAREPOINT_HTTPS_DOMAIN/_api/Web/GetFolderByServerRelativeUrl('/Briefing%2002032017')/Properties"
'        }
'      },
'      "Folders": {
'        "__deferred": {
'          "uri": "https://SHAREPOINT_HTTPS_DOMAIN/_api/Web/GetFolderByServerRelativeUrl('/Briefing%2002032017')/Folders"
'        }
'      },
'      "ItemCount": 9,
'      "Name": "Briefing 02032017",
'      "ServerRelativeUrl": "/Briefing 02032017",
'      "WelcomePage": ""
'    }
'  }
' 

outFile.Close

 

© 2000-2016 Chilkat Software, Inc. All Rights Reserved.