| | |
Code for Call the program in Visual Basic
![]() |
I dont have the code you would use on me but it would be something like call powerpoint first with an argument of calling the file you want it to open. if i find the code i have to open word docs i will give it to you but the pc its on isnt booting up right now so i dont know if i will beable to help you but that should give you an idea of what to do 
found it
im sure if you modify that to open powerpoint instead of word and then put the file you want at the end it should work, good luck

found it
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim shell, fso Set shell = CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") shell.Run """C:\Program Files\Microsoft Office\Office10\WINWORD.exe"" file.doc"
im sure if you modify that to open powerpoint instead of word and then put the file you want at the end it should work, good luck
•
•
Join Date: Feb 2005
Posts: 16
Reputation:
Solved Threads: 0
Sorry, I don't understand your code. Can you explian it more for me please?
Or can you create it for me please? Thanks!
-------
This is your code:
Dim shell, fso
Set shell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
shell.Run """C:\Program Files\Microsoft Office\Office10\WINWORD.exe"" file.doc"
-------
Oh! do you know some code that can call file beside *.exe.
seyha
Or can you create it for me please? Thanks!
-------
This is your code:
Dim shell, fso
Set shell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
shell.Run """C:\Program Files\Microsoft Office\Office10\WINWORD.exe"" file.doc"
-------
Oh! do you know some code that can call file beside *.exe.
seyha
in a module
then in your button or whatever
It's off the top of my head, but that should work.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
then in your button or whatever
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
retval = shellexecute(0&, "whatever.pps", vbnullstring, vbnullstring, 1)
It's off the top of my head, but that should work.
•
•
Join Date: Feb 2005
Posts: 16
Reputation:
Solved Threads: 0
Sorry, Your code it doesn't work. It said "Argument not optional".
Can you hepl me with this problem?
thanks!
Seyha
Can you hepl me with this problem?
thanks!
Seyha
•
•
•
•
Originally Posted by Comatose
in a module
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
then in your button or whatever
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
retval = shellexecute(0&, "whatever.pps", vbnullstring, vbnullstring, 1)
It's off the top of my head, but that should work.
oops, sorry
don't forget to change "Form1" to the name of your form (any form you have), and change "whatever.pps" to whatever file you want to open.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
retval = ShellExecute(Form1.hwnd, "Open", "whatever.pps", 0&, 0&, 1)
don't forget to change "Form1" to the name of your form (any form you have), and change "whatever.pps" to whatever file you want to open.
•
•
Join Date: Feb 2005
Posts: 16
Reputation:
Solved Threads: 0
I have one more question. Can you help me please?
If I have file on drive C and my file my is aa.pps so on whatever.pps is C:\aa.pps, that is right? My question is I want to make it to aa.exe and I put it on the CD (I copy file aa.pps and aa.exe on CD too, I do have file on my drive C anymore) What Code I should change on whatever.pps?
Thanks!
Seyha
If I have file on drive C and my file my is aa.pps so on whatever.pps is C:\aa.pps, that is right? My question is I want to make it to aa.exe and I put it on the CD (I copy file aa.pps and aa.exe on CD too, I do have file on my drive C anymore) What Code I should change on whatever.pps?
Thanks!
Seyha
•
•
•
•
Originally Posted by Comatose
oops, sorry
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
retval = ShellExecute(Form1.hwnd, "Open", "whatever.pps", 0&, 0&, 1)
don't forget to change "Form1" to the name of your form (any form you have), and change "whatever.pps" to whatever file you want to open.
•
•
Join Date: Feb 2005
Posts: 16
Reputation:
Solved Threads: 0
Sorry, that I ask you the question not clear. I want to ask you about the code for chang drive, because when I compile to exe and I want to put it on the CD but it doesn't work because I don't have file *.pps on the drive C:.
Thanks!
seyha
Thanks!
seyha
•
•
•
•
Originally Posted by Comatose
I don't understand what you are asking. you can change "whatever.pps" to "c:\myfile.pps" or whatever.... and it will still work. Is that what you are asking? (the answer is yes... you can specify a path and file name)
Ah.... pretty sure:
app.path references any location that your program is run from. So, if you make sure whatever.pps is in the same folder as your exe, it will work fine.
if you are unsure how the string looks for app.path, just do a msgbox on it.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
retval = ShellExecute(Form1.hwnd, "Open", app.path & "\whatever.pps", 0&, 0&, 1)
app.path references any location that your program is run from. So, if you make sure whatever.pps is in the same folder as your exe, it will work fine.
if you are unsure how the string looks for app.path, just do a msgbox on it.
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Random Number Generator
- Next Thread: Update SQL database automatically using VB6
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






