<p>What I'm trying to do is encode a gif file, to include in an XML document.
This is what I have now, but it doesn't seem to work.</p>

<pre><code>Function gifToBase64(strGifFilename)
 On Error Resume Next
 Dim strBase64
 Set inputStream = WScript.CreateObject("ADODB.Stream")
 inputStream.LoadFromFile strGifFilename
 strBase64 = inputStream.Text
 Set inputStream = Nothing
 gifToBase64 = strBase64
End Function
</code></pre>

Take a look here:
Base64 Encode & Decode Files with VBScript
. This example relies on the free
XBase64 component
and merely provides a wrapper for file handling.
You can also go for a
pure VBScript implementation
, but here you have to care for the file handling yourself. Should not be too difficult, but encoding performance will be not as good. For a few small image files it will be enough, though.
Google will turn up more.