Help with VB 4.0

D

David Ogden

Hello

I know this is an old version, but it's the only one I've
got. I'm a Newbie to this software.

I'm wanting to create an Executable form that contains a
menu to open up various documents.
These include
Presentations (pps) files
Word Documents (doc) files
Powerpoint (exe) file

I've had a stab at this but I'm not sure which VB command
to use. I've looked at the Open and Get command but this
does not seem to work.

Is it best to open the files using Autorun files linked
via the menu?

Any help appreciated

David.
 
J

Jonathan West

Hi David

David Ogden said:
Hello

I know this is an old version, but it's the only one I've
got. I'm a Newbie to this software.

I'm wanting to create an Executable form that contains a
menu to open up various documents.
These include
Presentations (pps) files
Word Documents (doc) files
Powerpoint (exe) file

I've had a stab at this but I'm not sure which VB command
to use. I've looked at the Open and Get command but this
does not seem to work.

Is it best to open the files using Autorun files linked
via the menu?

Any help appreciated


These articles should point you in the right direction. The code samples in
them should work OK in VB as well as VBA.

Control Excel from Word
http://word.mvps.org/FAQs/InterDev/ControlXLFromWord.htm

Control Outlook from Word
http://word.mvps.org/FAQs/InterDev/ControlOLFromWord.htm

Control Word from Excel
http://word.mvps.org/FAQs/InterDev/ControlWordFromXL.htm

Early vs. Late Binding
http://word.mvps.org/FAQs/InterDev/EarlyvsLateBinding.htm
 
K

Karl E. Peterson

Hi David --
I'm wanting to create an Executable form that contains a
menu to open up various documents.
These include
Presentations (pps) files
Word Documents (doc) files

If you simply want to open those documents, and not manipulate them in their host
applications, you can use ShellExecute. Here's an API-based function that launches
any URL in the default browser:

Private 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

Public Function HyperJump(ByVal URL As String) As Long
HyperJump = ShellExecute(0&, vbNullString, URL, vbNullString, vbNullString,
vbNormalFocus)
End Function

Actually, and this is meant precisely, it will perform the default action on any
given filetype using the associated application. IOW, if you were to right-click on
a DOC file, and "Open" was in bold, that's what would happen if you passed the
complete name of that file to this function.
Powerpoint (exe) file

Just use VB's native Shell function for executables.
I've had a stab at this but I'm not sure which VB command
to use. I've looked at the Open and Get command but this
does not seem to work.

Those are for getting at the actual "guts" of the files.
Is it best to open the files using Autorun files linked
via the menu?

Dunno what that means.

Later... Karl
 

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