VB6 Shell,打开RTF文件时出错. [英] VB6 Shell, Error in opening an RTF file.
本文介绍了VB6 Shell,打开RTF文件时出错.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个自动打开RTF文件的程序.
这是我的代码
I have a program that automatically opens a RTF file.
This is my code
Shell "C:\Program Files\Windows NT\Accessories\wordpad.exe " & rtfPath, vbNormalFocus
执行该行时,将打开写字板,但我在写字板中遇到此错误
C:\RTF Cannot find this file. Please verify that the correct file name are given.
好吧,实际路径是这个C:\RTF Files\000001.rtf
,我认为问题是空间.有没有一种方法可以打开文件,即使文件路径中有空格也是如此.
谢谢
When the line is executed the Wordpad opens but I''m getting this error in Wordpad
C:\RTF Cannot find this file. Please verify that the correct file name are given.
Well the actual path is this C:\RTF Files\000001.rtf
and I think the problem is the space. Is there a way to open the file even the file path has space.
Thanks
推荐答案
您可能需要将路径字符串放在双引号中才能被接受.我不了解VB,但在C/C ++/C#中会是:
You may need to put the path string in double quotes to get it accepted. I don''t know VB but in C/C++/C# it would be:
string rtfPath = "\"C:\\RTF Files\\000001.rtf\"";
这篇关于VB6 Shell,打开RTF文件时出错.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文