Well Microsoft has released some Tools and Frameworks for Open Techechnologies.
Building bridges between Microsoft and non-Microsoft technologies.
Powering interoperability through open standards and open source.
One of them is PowerTools for Open XML
Open XML is used by MS Office 2007 and upwards.
Have you ever wanted to create or manage MS Office Documents, without having Office installed.
Well here we go :
1. First download the PowerTools for Open XML
Go for the version 3.1.0x or higher
2. Extract the files somerwhere, and install the PS Module.
3. Create a new Module Folder called “OxPt”
4. Copy these folders and files over there :
5. Next download and install the Install the OpenXML SDK 2.5
6. Next Open the PS IDE and run a Test like this :
CLS import-module OxPt New-Docx C:\test.docx -comment
As you can see there are many switches you apply
You will get a test document created with a comment in it.
This format is also compatible with the older version like MS Office 2007.
If you get this error :
New-Object : Cannot find type [System.Collections.Generic.List[OpenXmlPowerTools.Source]]: make sure the assembly containing this type is loaded.
Then you should move over to PS x64 instead of x32 !
Available Cmdlets :
Check it out