Home Forums General XMetaL Discussion xml property of ActiveDocument object and UTF-8 Reply To: xml property of ActiveDocument object and UTF-8

LeeHart

Reply to: xml property of ActiveDocument object and UTF-8

We're just using FSO. Here's the macro:

g_Preview = 0 Sub runCode() g_Preview = 1 Dim strFilename
Dim fso strFilename = ActiveDocument.Path & Chr(92) & Mid(ActiveDocument.BrowserURL, InStrRev(ActiveDocument.BrowserURL, “/”) + 1)
Set fso = CreateObject(“Scripting.FileSystemObject”) ' Force save, copy saved file to temporary BrowserURL file
ActiveDocument.Save
fso.CopyFile ActiveDocument.FullName, strFilename, true Set strFilename = Nothing
Set fso = Nothing End Sub
]]>

Previously the CopyFile line was similar to this:
Set file = fso.OpenTextFile(strFilename, 2, -2) ' for writing, tristate-default

' replace contents of temporary file with the current document
file.Write ActiveDocument.xml

(I'm not including the declaration or cleanup of the file variable.)

Thanks,

Lee

Reply

Products
Downloads
Support