This must be a simple error
Hi all,
I am trying to get an swf file to open when a command button is clicked.
I though this would be the code needed
VB Code:
Private Sub Command6_Click()
Shell "C:\myfolder\test.swf", vbNormalFocus
End Sub
any one know what I've done wrong?
thanks
Re: This must be a simple error
I think you need to either use ShellExecute, or supply the program name in the shell statement. You must also supply the path for the program and the flash.swf.
Re: This must be a simple error
I have tried adding it to a separate form and then loading that form from button. Will this way work better or the first do you know?
thanks
Re: This must be a simple error
As dglienna implied, the Shell command is used to run a program and not open a file so it doesn't matter where you put it in your program.
Re: This must be a simple error
This is what dgliena was talking about:
http://www.vbforums.com/showthread.p...t=shellexecute
Use that instead of Shell...
Re: This must be a simple error
also with my version of flash player swf files are not ascoiated with the flash player :(
so u may want 2 run it like this:
VB Code:
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
ShellExecute Me.hWnd, "", "iexplore.exe", SWFFILEHERE, "", 1
:)
Re: This must be a simple error
you need to embed the player in your form, or just use IE as it has a player built in. Have an instance of IE inside of your form.
Re: This must be a simple error
To embed the swf file in a form do I Just insert flash from the toolbar and then select the path to the movie in the properties?
Re: This must be a simple error
if you have the flash player. i thought you'd have to add a reference or a component. my ide is tied up figuring out 9^9^9 using Woka's code. No telling when it'll be done!
Re: This must be a simple error
hey i checked my components and references...
i could see no flash there..???
but i have flash installed in my system.. :ehh:
nean
Re: This must be a simple error
FLASH! :wave:
I found this:
Re: This must be a simple error
I can add my flash movie like this but the buttons on my flash movie wont work. Any ideas?