'
' This example demonstrates how to uninstall an add-on package.
'
sPath = InstallationPath( siUserPath )
sHTMLName = makeHTMLPage()
' Create the add-on package object
set oAddOn = Application.CreateAddon
' Add the HTML page to the add-on package
oAddOn.AddOtherItem sHTMLName
' Save the package in the Addons directory
sAddOnFileName = sPath & "\Addons\myHelpPkg.xsiaddon"
oAddOn.Save sAddOnFileName
' Install the add-on package containing the HTML page
Application.InstallAddOn sAddOnFileName, siUserAddonPath
' Paste the following line (uncommented) into the script editor to uninstall it:
REM Application.UnInstallAddon sAddOnFileName
' **********************************
' This function just provide the means to remove the details of
' creating the HTML page.
function makeHTMLPage()
' Build the filename & path
sHelpFileName = sPath & "\Data\HelpMe.html"
' Create a standard hello world script file
set fso = CreateObject( "Scripting.FileSystemObject" )
set fHWFile = fso.CreateTextFile( sHelpFileName )
fHWFile.WriteLine "<html>"
fHWFile.WriteLine "<head>"
fHWFile.WriteLine vbTab & "<title>Help Page for Testing Add-ons</title>"
fHWFile.WriteLine "</head>"
fHWFile.WriteLine "<body>"
fHWFile.WriteLine vbTab & "<p>Help! I'm trapped inside this HTML code!</p>"
fHWFile.WriteLine "</body>"
fHWFile.WriteLine "</html>"
fHWFile.Close
' Return the name of the new command
makeHTMLPage = sHelpFileName
end function
|