VBScript Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

VBScript Examples

Bounced Mail
Bz2
Character Encoding
Digital Certificates
CSV
Digital Signatures
Email
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
PFX
RSA
S/MIME
SFTP
SMTP
Socket
Spider
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression
Self-Extractor

More Examples...
Amazon S3
Email Object
DKIM / DomainKey
NTLM
FileAccess
Byte Array
RSS
Atom
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

 

Saving and Retrieving Data in XML

Saving and retrieving data in XML.

Download Chilkat Email ActiveX

Download Chilkat XML ActiveX

Download 32-bit Chilkat IMAP ActiveX (.msi)

Download All 32-bit Chilkat ActiveX Components (.zip)

Download All 64-bit Chilkat ActiveX Components (.zip)

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


'  Create an XML file with data that will later be loaded and
'  accessed by field name:
set xml = CreateObject("Chilkat.Xml")
xml.Tag = "emailData"

xml.NewChild2 "from","admin@chilkatsoft.com"
xml.NewChild2 "toName","Chilkat Support"
xml.NewChild2 "toAddr","support@chilkatsoft.com"
xml.NewChild2 "subject","This is a test"
xml.NewChild2 "body","This is an email body"

'  Save the XML:

success = xml.SaveXml("emailData.xml")
If (success <> 1) Then
    MsgBox xml.LastErrorText
    WScript.Quit
End If

set xml2 = CreateObject("Chilkat.Xml")

'  Load the XML file:
success = xml2.LoadXmlFile("emailData.xml")
If (success <> 1) Then
    MsgBox xml2.LastErrorText
    WScript.Quit
End If

'  Access the data by name
outFile.WriteLine(xml2.GetChildContent("from"))
outFile.WriteLine(xml2.GetChildContent("toName"))
outFile.WriteLine(xml2.GetChildContent("toAddr"))
outFile.WriteLine(xml2.GetChildContent("subject"))
outFile.WriteLine(xml2.GetChildContent("body"))
outFile.WriteLine("------")

'  Let's say I want to load this into an email object:
set email = CreateObject("Chilkat.Email2")

email.From = xml2.GetChildContent("from")

toName = xml2.GetChildContent("toName")
toAddr = xml2.GetChildContent("toAddr")
email.AddTo toName,toAddr
email.Subject = xml2.GetChildContent("subject")
email.Body = xml2.GetChildContent("body")

outFile.WriteLine(email.GetMime())


outFile.Close

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

Mail Component · XML Parser