View Single Post
 
Old 08-27-2015, 03:45 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

So, when you use:
objDom.Save ServerShare & "\" & Split(ActiveDocument.Name, ".")(0) & ".xml"
Does anything get saved? I'd be surprised if you got an xml file out if it, though, as simply changing the extension doesn't create an xml file - you'd really need to use the SaveAs2 method and specify the file type. For example:
Code:
objDom.SaveAs2 _
  FileName:=ServerShare & "\" & Split(ActiveDocument.Name, ".")(0) & ".xml", _
  FileFormat:=wdFormatXML, AddToRecentFiles:=False
(assuming the Word XML format is what you want, though true xml files are only plain text files, as we've discussed before, and for which you could just as easily replace wdFormatXML with one of wdFormatText, wdFormatTextLineBreaks, wdFormatDOSText or wdFormatDOSTextLineBreaks).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote