Tuesday, March 31, 2009

It would appear that most of the corporate world is still running Office 2003, which is fine - I am sure you have your reasons! But why the F*(K haven't you deployed the compatibility pack to view Office 2007 documents?

The hassle more than likely comes back to the sender (you!!) with a request to change the format of their documents, and although it isn't really my problem I have to oblige (otherwise, they may not pay my invoice).

==========
RANT OVER
==========

The script below will convert any Office 2007 (DOCX) files in a folder to a Office 97-2003 (DOC) format using the Office automation API.

get-childItem -filter *.docx | foreach {
  
$doc = "$($_.fullname)"
  
$2000doc = $($doc.substring(0,$($doc.length - 1)))
  
$office = New-Object -ComObject word.application

  
write-host "Opening - $doc"
  
$word = $office.Documents.Open($doc)

  
write-host "Saving - $2000doc"
  
$word.SaveAs2000($2000doc)

  
$word.close()
  
$office.quit()
}

Tuesday, March 31, 2009 7:20:46 PM (E. Australia Standard Time, UTC+10:00)
Navigation
Search
On this page....
Archives
<March 2010>
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910
Categories
Blogroll
Contact me
Send mail to the author(s) E-mail
Powered by

newtelligence dasBlog 2.0.7226.0.