开发者

Word command-line-arguments space issues

开发者 https://www.devze.com 2023-04-02 15:01 出处:网络
I want to pass parameters to winword in order to read it in my vsto addin by using Environment.GetCommandLineArgs().

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 开发者_StackOverflowworking:

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


Try with the following command :

winword.exe "/myVar1:C:\folder with space\whatever1.doc" "/myVar2:C:\folder with space 2\somethingelese.txt" C:\example.doc

If it still doesn't work, send us the content of the array returned by GetCommandLineArgs.

0

精彩评论

暂无评论...
验证码 换一张
取 消