Previewing Excel or Word while in Access

B

Bill Murphy

In my Access app I would like the user to be able to click on the name of an
Excel or Word document in a list and preview it, then close it and return to
Access. Currently I'm using the shellexecute api, in the fHandleFile
function provided by Dev Avish on The Access Web. This works well, but
after opening maximized, the Excel or Word document immediately minimizes to
the user's Windows task bar. In the click event I'm making the Access form
not visible, then making it visible after calling fHandleFile, as shown
below:

dim x as boolean
me.visible = false
x = fHandleFile(Me!FileName, WIN_MAX) ' opens the Excel or Word maximized
using apishellexecute
me.visible = true

Is there a way to prevent the Excel or Word document from minimizing? And,
prevent the Access form from becoming visible until the user has closed the
document being previewed?

Bill
 
E

Emilia Maxim

Bill Murphy said:
In my Access app I would like the user to be able to click on the name of an
Excel or Word document in a list and preview it, then close it and return to
Access. Currently I'm using the shellexecute api, in the fHandleFile
function provided by Dev Avish on The Access Web. This works well, but
after opening maximized, the Excel or Word document immediately minimizes to
the user's Windows task bar. In the click event I'm making the Access form
not visible, then making it visible after calling fHandleFile, as shown
below:

dim x as boolean
me.visible = false
x = fHandleFile(Me!FileName, WIN_MAX) ' opens the Excel or Word maximized
using apishellexecute
me.visible = true

Is there a way to prevent the Excel or Word document from minimizing? And,
prevent the Access form from becoming visible until the user has closed the
document being previewed?

Bill,

a simpler solution would be to store the file name +path in a
hyperlink field. A simple click on the file name would open Word or
Excel on top of all other windows, just like when opening a browser.

Best regards
Emilia

Emilia Maxim
PC-SoftwareService, Stuttgart
http://www.maxim-software-service.de
 
B

Bill Murphy

Emilia,

Thanks for this info. That approach does open the Excel or Word on top, but
when the user closes the document their Access app is minimized on the
Windows task bar at the bottom of screen. Is there any way to prevent this?

Bill
 

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