Source Code and Samples

Thursday, 15 February 2007

Convert or export word documents to XPS

Description

Convert or export word documents to XPS

Data Source

#You need to install "Microsoft Office 2007 Add-in: Microsoft Save as PDF or XPS"
$word = new-object -ComObject "word.application"
$doc = $word.documents.open("C:\document.doc")
$saveaspath = [ref] "c:\document.xps"
$formatXPS = [ref] 18
$doc.SaveAs($saveaspath,$formatXPS)
$doc.Close()

No comments: