Example

This example finds all the Reflection for UNIX and OpenVMS settings files (*.r2w) in the current directory, uses SaveXML to save the color configuration settings for each file in XML format, then uses TransformXML to create HTML files that contain a summary of the color configuration information.

Sub TransformAllSettingsFiles()

Dim SettingsName As String 'directory list

Dim MyName As String 'base filename

Dim Extn As Integer 'base filename length

 

' Find the first settings file in current directory

SettingsName = Dir("*.r2w")

 

Do While SettingsName <> ""

' Remove the extension from the end of filename

Extn = InStr(SettingsName, ".r2w") - 1

MyName = VBA.Left(SettingsName, Extn)

 

' Save color information in XML format, and convert result to

' an HTML file.

Session.SaveXML MyName & ".xml", rcXMLColors, rcOverwrite, rcAll

Session.TransformXML MyName & ".xml", _

"c:\mypath\MyTransform.xsl", MyName & ".html"

 

' Call Dir again without arguments to get next matching file

SettingsName = Dir

Loop

End Sub