Category Archives: Office 2013

WMF 5.0 COM applications

One change in WMF 5.0 that I hadn’t got round to testing was the speed up in COM based operations. COM – Component Object Model – was the Microsoft programming model before .NET.  Its old but still around – the … Continue reading

Posted in COM, Office 2013, PowerShell v5, WMFv5 | Leave a comment

Add a drop down to a Word document

  Its surprisingly easy to programatically add a drop down list to Word document   $Word = New-Object -Com Word.Application$word.visible = $true$template = “c:\test\template.docx”   $Doc = $Word.Documents.Open($template)$Doc.Activate()    $cntrl = [Enum]::Parse([Microsoft.Office.Interop.Word.WdContentControlType], “wdContentControlDropdownList”) $objCC = $doc.ContentControls.Add($cntrl) $objCC.DropdownListEntries.Add(“PowerShell”)$objCC.DropdownListEntries.Add(“Ruby”)$objCC.DropdownListEntries.Add(“Perl”)   Create the COM object … Continue reading

Posted in Office 2013, Powershell | 1 Comment

OneNote and XML–finding pages

Pages are towards the bottom of the hierarchy in OneNote – though we still haven’t dived into the content of pages yet.   You can find the pages in your notebooks like this:   $onenote = New-Object -ComObject OneNote.Application$scope = … Continue reading

Posted in Office 2013, Powershell | Leave a comment

OneNote and XML–finding sections

I recently showed how to find the names of your OneNote notebooks.  The next level down is the section.  You can find these sections in a notebook like this:   $onenote = New-Object -ComObject OneNote.Application$scope = [Microsoft.Office.Interop.OneNote.HierarchyScope]::hsPages[ref]$xml = ”   … Continue reading

Posted in Office 2013, Powershell | Leave a comment

OneNote and XML–finding notebooks

When OneNote first came out there wasn’t an API for it as you get for Word or Excel. A community module enabled you to work with the XML that formed the OneNote note books but it wasn’t updated after Office … Continue reading

Posted in Office 2013, Powershell | 1 Comment

Update on Office error

Back in this post https://richardspowershellblog.wordpress.com/2012/10/15/powershell-3-and-word/ I showed that this code $word = New-Object -ComObject “Word.application”            $word.visible = $true            $doc = $word.Documents.Add()            $doc.Activate()                        $word.Selection.Font.Name = “Cambria”            $word.Selection.Font.Size = “20”            $word.Selection.TypeText(“PowerShell”)            $word.Selection.TypeParagraph()                        $word.Selection.Font.Name = “Calibri”            $word.Selection.Font.Size = “12”            $word.Selection.TypeText(“The best … Continue reading

Posted in Office 2013, PowerShell v4, Windows 8.1 | Leave a comment

Status of Office software

You can also use the SoftwareLicensingProduct CIM class to test the status of your Office products. Get-CimInstance -ClassName SoftwareLicensingProduct -Filter “Name LIKE ‘Office%’” | where PartialProductKey | select Name, ApplicationId, LicenseStatus You need to be careful with Office as you … Continue reading

Posted in CIM, Office 2010, Office 2013, PowerShell and WMI, PowerShell V3, PowerShell v4 | 4 Comments