Skip to content

Instantly share code, notes, and snippets.

@Zmegolaz
Zmegolaz / comments2xlsx.vb
Last active May 26, 2024 13:47 — forked from razorgoto/comments2xlsx.vb
Exports comments from a MS Word document to Excel and associates them with the heading paragraphs
Sub exportComments()
' Forked from https://gist.github.com/razorgoto/cff2ffd5da93220c643c, updated to work with Library 16.0.
' This also fixes a bug where it crashed if there was a comment on the very first header.
' Exports comments from a MS Word document to Excel and associates them with the heading paragraphs
' they are included in. Useful for outline numbered section, i.e. 3.2.1.5....
' Thanks to Graham Mayor, http://answers.microsoft.com/en-us/office/forum/office_2007-customize/export-word-review-comments-in-excel/54818c46-b7d2-416c-a4e3-3131ab68809c
' and Wade Tai, http://msdn.microsoft.com/en-us/library/aa140225(v=office.10).aspx
' Need to set a VBA reference to "Microsoft Excel 16.0 Object Library". 14.0 works too.
' Go to the Tools Menu, and click "Reference"
@nopslider
nopslider / gist:7a6136ab78dbda2a5819
Last active August 30, 2023 15:06
Find enabled users in a specified AD group with PowerShell
Get-ADGroup -Filter {(name -like "*admins*") -or (name -like "*administrator*")} `
| Get-ADGroupMember -Recursive | Where { $_.objectClass -eq "user" } `
| Get-ADUser -properties * | where {$_.enabled -eq $true} `
| where {$_.lockedout -eq $false} | select SamAccountName -unique