Msgbox更改按钮标题为vbs

时间:2014-02-26 14:11:19

标签: button vbscript caption msgbox

Option Explicit
Const conForReading = 1
Dim objFSO, objReadFile, objFile, contents, result, shell
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("C:\read.txt") 

If objFile.Size  Then 
Set objReadFile = objFSO.OpenTextFile("C:\read.txt", 1, False)
contents = objReadFile.ReadAll
result = MsgBox ("text2" & contents & "text1",vbYesNo+vbExclamation,"TITLE")
Select Case result
Case vbYes
Set shell = wscript.CreateObject("Shell.Application")
shell.Open "D:\folder"
Case vbNo
End Select
objReadFile.close

Else 
End If  

Set objFSO = Nothing 
Set objReadFile = Nothing 
WScript.Quit() 

我有这个vbs文件,我想更改vbYesNo标题,是打开文件夹,没有退出。但我不知道怎么做,我找不到办法做到这一点。也许我错过了一件容易的事,因为我是编程新手。但我想了解这一点。

1 个答案:

答案 0 :(得分:2)

这是不可能的。使用MessageBox函数没有选项。您的选择是:

OK
OK, Cancel
Abort, Retry, Ignore
Yes, No, Cancel
Yes, No
Retry, Cancel

参考: http://msdn.microsoft.com/en-us/library/sfw6660x(v=vs.84).aspx

相关问题