• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1039
  • Last Modified:

Convert Word xml to doc

Hi,

Our MIS outputs pupil reports in Word xml files.  I want to batch convert these documents to .doc files while maintaining all the formating and layout.  I have attached two files for reference.  If possible I would like to run a script that will convert all  .xml the files in a folder into .doc.

I cannot upload .xml as the extension is not allowed so you can download the test files from http://www.deanesafl.com/TestFiles.zip

Thanks,

Desi
0
DesiMck
Asked:
DesiMck
  • 2
1 Solution
 
GrahamSkanCommented:
You could try this Word macro
Sub SaveXMLFileAsDOC()
    Dim strFolder As String
    Dim strFile As String
    Dim doc As Document
    strFolder = "C:\MyFolder"
    strFile = Dir$(strFolder & "\*.xml")
    Do Until strFile = ""
        Set doc = Documents.Open(strFolder & "\" & strFile)
        doc.SaveAs strFolder & "\" & Replace$(strFile, ".xml", ".doc"), wdFormatDocument
        doc.Close wdDoNotSaveChanges
        strFile = Dir$()
    Loop
End Sub

Open in new window

0
 
DesiMckAuthor Commented:
Hi,
 
this almost works excpet for one part.  The graph on the first file does not show.  Instead the following appears {EMBED MSGraph.Chart8 \s}
Pressing Alt + F9 will bring the graph up but is there a way to automatically do this.
 
Thanks for your quick response,
 
Desi

0
 
DesiMckAuthor Commented:
Ignore my last post - thank you, this is excellent.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now