我想传递参数,以便通过使用Environment.GetCommandLineArgs读它在我的VSTO插件到WINWORD()。字的命令行参数空间问题
如果一个参数值包含空格,我无法逃脱字符串。
这是工作:
winword.exe /myVar1:C:\folder\whatever1.doc /myVar2:C:\folder\somethingelese.txt C:\example.doc
这不是工作:
winword.exe /myVar1:"C:\folder with space\whatever1.doc" /myVar2:"C:\folder with space 2\somethingelese.txt" C:\example.doc
如果你还没有完全放弃这个,我注意到,第二个例子中打开一个Word 2007的模板时,对我的作品。你使用的是不同版本的Word吗? – Chris