1
votes

I've been developing an outlook add-in using Outlook 2007 since, well, 2007. Today I just upgraded to Outlook 2019 on the dev machine, and ran into an issue.

With outlook 2007 I had setup visual studio to debug my add in using the following command line arguments:

/select outlook:inbox -parserconfig:"C:\somepath.xml"

My addin would look for the command line switch parserconfig and, if it is found, uses that config instead of some other default. It worked great because I could have my addin on the dev machine behave differently than in production. Anyway, using the same approach with Outlook 2019 doesn't work; it refuses to start and complains

Cannot start Microsoft Outlook. The command line argument is not valid. Verify the switch you are using.

Is there a way to pass custom command line arguments to Outlook add-ins in Outlook 2019, like I could with Outlook 2007?

1

1 Answers

0
votes

There is no way to pass custom command line arguments. COM add-ins are not treated like standalone applications. Command-line parameters are for applications, not add-ins. So, I suspect this hidden feature was silently removed by MS developers. Instead, you can create a configuration file (or any other file on the disk) and read it when your add-in is loaded. You may consider using conditional compilation symbols to get the data loaded in your dev environment only.

See the full list of supported command line parameters with their descriptions on the Command-line switches for Microsoft Office products page.