ole event

C

Chetan I. Rathi

Hi there,
I want to write a code on double clink event of ole object. By doing double
click a specific programme is opened. For example if I I want to open word
document each time, then If I do double click on ole filed it should
automatically open word file. Does any one know what is the actual code to do
this? I am sure code is to be written on double click event but I am not
getting how I can do this?

I will be thankful for some one who can help me on this.

Thanking in advance
Rathi
 
W

Wayne-I-M

Hi Chetan

You can shell call the app like this

Private Sub ControlName_Click()
Call Shell("Path to app goes here", 1)
End Sub

as an example if your word app is stored on your C drive it may look
something like this.

Private Sub ControlName_Click()
Call Shell("C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE", 1)
End Sub
 
C

Chetan I. Rathi

thanks wayne for your help each time.
Cheers

Wayne-I-M said:
Hi Chetan

You can shell call the app like this

Private Sub ControlName_Click()
Call Shell("Path to app goes here", 1)
End Sub

as an example if your word app is stored on your C drive it may look
something like this.

Private Sub ControlName_Click()
Call Shell("C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE", 1)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top