Since the introduction of Word version 2211, I've had a problem with a VB.NET application that generates a data set (DAT file) and automatically merges with Word templates. I see the Word object open (with "Viewing" showing in the top right) but then closes throwing back the error
"The OpenDataSource method or property is not available because a macro is currently running."
It appears to relate to the new "Editing", "Reviewing" and "Viewing" options introduced in Word. The application uses the Microsoft interop to interact with the Word object and I believe the code it fails on is "MailMerge.OpenDataSource".
Rolling back the version to 2209 resolves the issue, so it definitely relates to functionality introduced in 2211 onwards. I've also tried in the beta channel for 2301 but that also has the same issue.
It seems that when it opens the template file, it defaults to opening in "Viewing" mode and I guess this is what is preventing the mail merge? Are there any options to prevent a document opening in "Viewing" mode? It's all done programmatically, so not sure if it would require development work on the application or if a setting can be changed in Word.