Showing posts with label Office Automation. Show all posts
Showing posts with label Office Automation. Show all posts

Tuesday, February 2, 2016

PowerShell to upload a file into multiple sites under Project Web App (Office 365)

This is a powershell script custom written to upload an Excel report to multiple Project Online sites, but you could easily customize it to suit your own purposes. The same method works on Office 365 and SharePoint Online sites.

Prerequisites:
You will need to install the SharePoint 2013 client components on your client machine. I am running it on Windows 7 so I am actually using the PowerShell 64 bit version and 64bit client components.

 # Load SharePoint Client  
 Add-Type –Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"   
 Add-Type –Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"   

I am using the newest version on Project online, hence the 16 hive. 15 hive works as well!

Sunday, November 2, 2014

Convert PowerPoint slides to Images in C#

One of the challenges I have come across is to have a component that could batch convert PPT and PPTX files into images.

I know there are really good components out there like Aspose, but IT budget is always a constraint.
As we already had Office 2010 installed on our machine, I came up with a quick console application t perform the function.

Obviously, you need Office 2010 installed on the machine where you need to run the tool. I compiled the project for the .NET 2.0 Framework.

Just add some references to your Visual Studio 2010 solution like below:
Microsoft.Office.Interop.PowerPoint (from .NET, v14.0.0.0)
Microsoft.Office.Core (from COM, v14.0.0.0)
Others like System.Configuration (as I am using app.config)

After creating a basic C# Console application, add the references mentioned above.

Related Posts Plugin for WordPress, Blogger...