主题:急! 请教在compaq VF 中添加插件的问题
各位达人,请教个小问题
我想模仿http://www.programfan.com/club/showbbs.asp?id=124318
做法那样用VB写个 dms为后缀的文件,想在vb中用shell函数调用exe可执行文件,但是系统提示有错误。是什么问题,或有别的办法调用exe可执行程序吗?
(本代码在VB开发环境下可行,但是在fortran的MACRO文件下就不行了)
十分感谢!急急急!
我的源码:
Function FileType (ByVal doc)
ext = doc.Name
FileType = 0
pos = Instr(ext, ".")
if pos > 0 then
Do While pos <> 1
ext = Mid(ext, pos, Len(ext) - pos + 1)
pos = Instr(ext, ".")
Loop
ext = LCase(ext)
end if
If ext = ".f90" Then
FileType = 8
ElseIf ext = ".for" Or ext = ".f" Then
FileType = 9
Else
FileType = 0
End If
End Function
Sub OpenNotepod ()
'DESCRIPTION: 调用 cmd.exe 系统函数
Dim win
' Dim ProcID As Integer
set win = ActiveWindow
if win.type <> "Text" Then
MsgBox "This macro can only be run when a text editor window is active."
else
TypeOfFile = FileType(ActiveDocument)
If TypeOfFile = 8 Or TypeOfFile = 9 Then
ProcID = Shell("cmd.exe",AppWinStyle.NormalFocus)
else
MsgBox("Unable to edit this file With notepad++ " + vbLf + _
"because the file type was unrecognized." + vbLf + _
"If the file has not yet been saved, " + vbLf + _
"please save it and try again.")
End If
End If
End Sub
我想模仿http://www.programfan.com/club/showbbs.asp?id=124318
做法那样用VB写个 dms为后缀的文件,想在vb中用shell函数调用exe可执行文件,但是系统提示有错误。是什么问题,或有别的办法调用exe可执行程序吗?
(本代码在VB开发环境下可行,但是在fortran的MACRO文件下就不行了)
十分感谢!急急急!
我的源码:
Function FileType (ByVal doc)
ext = doc.Name
FileType = 0
pos = Instr(ext, ".")
if pos > 0 then
Do While pos <> 1
ext = Mid(ext, pos, Len(ext) - pos + 1)
pos = Instr(ext, ".")
Loop
ext = LCase(ext)
end if
If ext = ".f90" Then
FileType = 8
ElseIf ext = ".for" Or ext = ".f" Then
FileType = 9
Else
FileType = 0
End If
End Function
Sub OpenNotepod ()
'DESCRIPTION: 调用 cmd.exe 系统函数
Dim win
' Dim ProcID As Integer
set win = ActiveWindow
if win.type <> "Text" Then
MsgBox "This macro can only be run when a text editor window is active."
else
TypeOfFile = FileType(ActiveDocument)
If TypeOfFile = 8 Or TypeOfFile = 9 Then
ProcID = Shell("cmd.exe",AppWinStyle.NormalFocus)
else
MsgBox("Unable to edit this file With notepad++ " + vbLf + _
"because the file type was unrecognized." + vbLf + _
"If the file has not yet been saved, " + vbLf + _
"please save it and try again.")
End If
End If
End Sub