The old code had:
varDlg =
varWord.Application.Dialogs[Microsoft.Office.Interop.Word.WdWordDialog.wdDialogFilePrint]
I don't know how to invoke the [] operator using reflection.
(also Microsoft.Office.Interop.Word.WdWordDialog.wdDialogFilePrint is not an
int, but an enum type)
These things are called indexed Properties
if you can index a property with [], this property has its own property call
"Item" by default. You can specify the index in the second argument of the
GetValue() method
This is the correct code:
PropertyInfo pi =
(varWord.GetType().Assembly.GetType("Microsoft.Office.Interop.Word.Dialogs")).GetProperty("Item");
varDlg = pi.GetValue(objDialogEnum, new Object[] {
objDialogEnumId });