hi, am brand new to VB. i have the same problem. i want to open a folder, say; My Computer on clicking a command button on VB GUI. i have something like this:
Private Sub Command1_Click()
ShellExecute hWnd, "open", "C:\apache", _
vbNullString, vbNullString, SW_SHOWNORMAL
End Sub
but it gives compilation error. "Sub or Function not defined"
can somebody help me out.
Regards,
Private Sub Command1_Click()
Shell "explorer.exe C:", vbMaximizedFocus
End Sub
If you want to open some other folder instead of "C:" just delete "C:" and write the path to the folder you want to open.
Hope it helps
here other ways to open msoffice for additional information just edit the path
Dim Word
Set Word = CreateObject("Word.Application")
Set doc = Word.documents.Add(App.path & "\DOCUCAI.doc")
Word.Visible = True
----------------
'Dim dTaskID As Double, path As String, file As String
path = "C:\WINDOWS\notepad.exe"
file = App.path & "\USERMANUAL.txt"
dTaskID = Shell(path + " " + file, vbNormalFocus)
---------------
Set power = CreateObject("PowerPoint.application")
power.Visible = True
Set doc = power.Presentations.Open(App.path & "\Ppoint.ppt")
power.activePresentation.slideShowSettings.Run
'pptObject.ActivePresentation.SlideShowSettings.Run
End Sub
all off those code will open msoffice files on the same folder where you save the put ur project..