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

Capacity planning series finished

My capacity planning series on the Scripting Guy blog finished last week. Didn’t get chance to post about it as I was at Microsoft in Seattle. Full series and associated powertip postings: http://blogs.technet.com/b/heyscriptingguy/archive/2013/11/18/powertip-compare-the-contents-of-files-with-powershell.aspxhttp://blogs.technet.com/b/heyscriptingguy/archive/2013/11/18/the-admin-s-first-steps-capacity-planning-part-3.aspx http://blogs.technet.com/b/heyscriptingguy/archive/2013/11/11/powertip-use-powershell-to-format-dates.aspxhttp://blogs.technet.com/b/heyscriptingguy/archive/2013/11/11/the-admin-s-first-steps-capacity-planning-part-2.aspx http://blogs.technet.com/b/heyscriptingguy/archive/2013/11/04/powertip-view-network-statistics-with-powershell.aspxhttp://blogs.technet.com/b/heyscriptingguy/archive/2013/11/04/the-admin-s-first-steps-capacity-planning.aspx Enjoy

Posted in Office 2013, Powershell, PowerShell and SQL Server, PowerShell and WMI | Leave a comment

Excel–named range

To create a named range in an Excel spreadsheet $xl = New-Object -ComObject ‘Excel.Application’$wkbk = $xl.Workbooks.Add()$sheet = $wkbk.WorkSheets.Item(1)$range = $xl.Range(“A1”, “D4”)$range.Name = “Test” Just to show how to work with named ranges $range2 = $xl.Range(“Test”)$range2.Borders.Color=0$range2.Borders.ColorIndex=26$range2.Borders.Weight=2$xl.visible = $true

Posted in Office 2013, PowerShell V3 | Leave a comment

Office365 ate me RSS feeds

Just been puzzling out why I haven’t been getting any RSS feeds for a few days.  Looks like when I hooked up my Office365 account to Outlook it took out all the RSS feeds.  Fun time to come putting them … Continue reading

Posted in Office 2013 | Leave a comment