Follow Hyperlink to .pps file

O

Opal

I am running Access 2003 and Powerpoint 2003.
I am using the Follow Hyperlink method to open
a .pps file from Access. My one issue is when it
opens powerpoint it does not open in slide show or
full screen....how can I achieve this through the
follow hyperlink method?
 
O

Opal

The same thing happens when I open excel files with
the same "Application.FollowHyperlink" method....
Does anyone know how to ensure these files
(excel or powerpoint) open full screen?
 
D

Dirk Goldgar

Opal said:
I am running Access 2003 and Powerpoint 2003.
I am using the Follow Hyperlink method to open
a .pps file from Access. My one issue is when it
opens powerpoint it does not open in slide show or
full screen....how can I achieve this through the
follow hyperlink method?


I doubt that you can do it through the FolllowHyperlink method. You can
open into a maximized window by calling the Windows API ShellExecute method,
but even that may not be what you want. You may need to use the VBA Shell
function to execute a command line that specifies the application's
executable, the target file to be opened, and the necessary command-line
switchs to get the application to open the file in the desired mode.
 
O

Opal

I doubt that you can do it through the FolllowHyperlink method.  You can
open into a maximized window by calling the Windows API ShellExecute method,
but even that may not be what you want.  You may need to use the VBA Shell
function to execute a command line that specifies the application's
executable, the target file to be opened, and the necessary command-line
switchs to get the application to open the file in the desired mode.

Hmmmm

The Shell function is something very new to me....so I have been
doing some research to try and figure this out.....if I understand
what I have been reading correctly, the Shell function calls a
..exe file. So, if I want to open something in full screen I have
to open the applicaton first and then the file...something like:

Dim RetVal

RetVal = Shell("C:\Program Files\Microsoft Office\OFFICE11\EXCEL.exe",
3)
Application.FollowHyperlink "D:\My Documents\Test.xls", , True

If I do the same with powerpoint there is a lag from the time the
application
opens the actual file to open. However indicating "3" as my
windowstyle
does open the application full screen.....

Am I doing this correctly? My other concern is that some computers
accessing this database will not have office directly installed on
them
but rather run the program through a server so I don't think this will
work for my purposes.
 
D

Dirk Goldgar

Opal said:
The Shell function is something very new to me....so I have been
doing some research to try and figure this out.....if I understand
what I have been reading correctly, the Shell function calls a
.exe file. So, if I want to open something in full screen I have
to open the applicaton first and then the file...something like:

Dim RetVal

RetVal = Shell("C:\Program Files\Microsoft Office\OFFICE11\EXCEL.exe", 3)
Application.FollowHyperlink "D:\My Documents\Test.xls", , True

If I do the same with powerpoint there is a lag from the time the
application opens the actual file to open. However indicating "3" as my
windowstyle does open the application full screen.....

You can probably do better than that. Shell doesn't so much run an
executable as it runs a command line, including an executable and any
command-line arguments it accepts. So if the executable you want to execute
accepts command-line arguments including, for example, the name of the file
to open, then you can do it all in one call to Shell:

Shell "excel.exe ""D:\My Documents\Test.xls""", vbMaximizedFocus

You may or may not have to specify the full path to the executable,
depending on whether it's in your system's PATH string. I find that I don't
have to give the full path to msaccess.exe or excel.exe, but you may find
different.
Am I doing this correctly? My other concern is that some computers
accessing this database will not have office directly installed on them
but rather run the program through a server so I don't think this will
work for my purposes.

If all you need to do is open the file, maximized, in the application that
is registered for that filetype, then you can do it by calling the
ShellExecute API with the file to be opened. That will identify the
appropriate application to open the file, start it in the requested window
mode, and tell it to open the file. You don't need to know the application
or where its executable is located. Code to call ShellExecute can be found
here:

http://www.mvps.org/access/api/api0018.htm
API: Start an app with ShellExecute

My concern is that you said something about starting PowerPoint in slideshow
mode. I'm not familiar with PowerPoint, so don't know if just starting the
application maximized and opening a .pps file will do that. There may be
command-line arguments that can be specified to control its behavior. If
you need to pass command-line arguments, you can do it with Shell, but I
don't know if or how there's a way to do this when you call the Windows
ShellExecute function.
 
O

Opal

Dirk,

So this won't make a difference if the application
is installed on the computer or is accessed through
a server? I will have to work with this some more
but am called away to work on some formulas in
excel right now so I have to put his project on
the back burner for a few days. Thank you for
the help and the link.
 
D

Dirk Goldgar

Opal said:
Dirk,

So this won't make a difference if the application
is installed on the computer or is accessed through
a server?

I can't swear to it from personal experience, but if you can double-click on
a .pps or .xls file and have the correct application open up, it should work
even if the application is installed on a server.
I will have to work with this some more
but am called away to work on some formulas in
excel right now so I have to put his project on
the back burner for a few days. Thank you for
the help and the link.

You're welcome. Please let us know how it works out.
 
O

Opal

Thanks so much Dirk. It works perfectly.

Since the users do not need to edit the powerpoint
presentations, I went with the pptview.exe and it works
just great!
 

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