Search word documents having datasource


I’m new here.

Is there a way to list all word documents, within a nested folder structure, having a (mailmerge) datasource ?

Thank you.

Welcome to Yes. It’s going to be two basic parts:

  • Find all Word files - look at Get-ChildItem with the Include and Recurse parameters. =
  • Find Word files with a MailMerge source - This is a bit more painful as you will need to open each document and check for the mailmerge source. Here is an example

There are some Powershell Modules and even ways to open Word as XML, but this should give you a starting point to put a script together.