Word命令行参数空间问题
我想将参数传递给 winword,以便使用 Environment.GetCommandLineArgs() 在我的 vsto 插件中读取它。
如果参数值包含空格,我将无法转义字符串。
这是工作:
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
I want to pass parameters to winword in order to read it in my vsto addin by using Environment.GetCommandLineArgs().
If a parameter-value contains a space I'm not able to escape the strings.
This is working:
winword.exe /myVar1:C:\folder\whatever1.doc /myVar2:C:\folder\somethingelese.txt C:\example.doc
This is not working:
winword.exe /myVar1:"C:\folder with space\whatever1.doc" /myVar2:"C:\folder with space 2\somethingelese.txt" C:\example.doc
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用以下命令:
如果仍然不起作用,请将 GetCommandLineArgs 返回的数组的内容发送给我们。
Try with the following command :
If it still doesn't work, send us the content of the array returned by GetCommandLineArgs.