Home › Forums › General XMetaL Discussion › xml property of ActiveDocument object and UTF-8 › Reply To: xml property of ActiveDocument object and UTF-8
Reply to: xml property of ActiveDocument object and UTF-8
July 14, 2010 at 6:47 pmWe're just using FSO. Here's the macro:
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