Powershell – using Open XML PowerTools Module

January 13, 2015

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”

%USERPROFILE%\Documents\WindowsPowerShell\Modules\OxPt

4. Copy these folders and files over there :

image

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

image

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.

image

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.

image

Then you should move over to PS x64 instead of x32 !

Available Cmdlets :

image

Check it out Smile


Modifying MS Office files using Google Docs

December 5, 2014

Ever wanted to open / edit and save MS Office documents without the need of Office 365 installed.

All you need is to have Chrome installed on your machine and add the MS Office Editing extension.

image

Solution :

1. Copy an Excel for to your Gdrive or go to https://drive.google.com and upload an MS Office file.

image

Once the XSL(X) file is uploaded, open it with Google Sheets, in this case.

2. Open the file and make some changes.

image

You will see now 2 files, the original and the new Google Sheets file.

image

The beauty is that you can work simultaneously on the file with multiple users !

The Original MS Office file you can open with Google Drive Viewer

image

3. Next download (save) the file again using the original XLSX Office file extension.

image

image

4. Open the new XLSX file in MS Excel, and check the result.

image

Works like a charm !

Done.

More information can be found here : View and edit Office files in Google Docs, Sheets, and Slides

Enjoy!