On May 8, 11:26=A0am, "Larry Linson" <boun...@[EMAIL PROTECTED]
> wrote:
> You can use the code athttp://www.mvps.org/access/api/api0001.htmto
open
> the Windows Common Dialog to allow the user to choose a file, and then
you=
> can use VBA code to use that file selection in the Shell function.
>
> When you follow hyperlink, it opens an instance of the software
registered=
> for the file-type... that is not part of your Application, nor in a
Contro=
l
> in your application. You would have to determine some API that would
make =
it
> the active window, or perhaps you could minimize the Access database you
a=
re
> running.
>
> =A0Larry Linson
> =A0Microsoft Office Access MVP
>
> "Ruben" <rubenfmu...@[EMAIL PROTECTED]
> wrote in message
>
>
news:d3c34892-136a-4fae-ba22-409949de6909@[EMAIL PROTECTED]
> On May 8, 2:24 am, kaisersose1995 <kaisersose1...@[EMAIL PROTECTED]
> wrote:
>
>
>
>
>
> > On 8 May, 01:23, Ruben <rubenfmu...@[EMAIL PROTECTED]
> wrote:
>
> > > Hello,
>
> > > I am using the "Application.FollowHyperlink strFilePath, , True"
line
> > > of code from within access forms to launch any file type I want
(e.g.,=
> > > xls, doc, pdf, etc.). The files open up okay, but open up in the
> > > background. How do I make them open in front where they are visible?
> > > I have tried various things like "Appliction.Visible=3DTrue / False"
> > > and "Screen.ActiveControl.Visible=3DTrue / False" but have not been
ab=
le
> > > to figure it out.
>
> > > Anyones help with this would be very much appreciated.
>
> > > Regards,
>
> > > Ruben Munoz
>
> > Instead of using FollowHyperlink have you considered using the Shell
> > command?
> > e.g
> > Shell("C:\MSOffice\OFFICE11\WINWORD.EXE C:\Somedir\..\..
> > \somefile.doc", vbMaximizedFocus)
>
> > this will open the word doc somefile, maximised on top of all other
> > windows.
>
> > Regards
>
> > Richard
>
> Thanks for your response. =A0Yes I have considered the Shell command.
> And although the Shell command works, I can't figure out how to make
> it work within my application.
>
> I am using Access 2000. =A0What this part of my application does is that
> it enables users to click on a hyperlink text field within a form in
> order to "attach" external do***ents such as xls, doc, pdf, etc., to
> the form. =A0This launches the Open File Dialog from which they can
> select the file they want to "attach". =A0Once a selection has been
> made, the file path to their do***ent is captured to that text field
> as a hyperlink that launches their file or do***ent the next time a
> user clicks on it.
>
> Unless there's a way to assign the "attached" file path within the
> Shell command to a string or variable, I don't know if the Shell
> command could be made to work in this case. =A0As it stands now,
> "Application.FollowHyperlink strFilePath, , True" is the only other
> line of code I found that works to the extent of opening up external
> files or applications, I just can't get these to open up on top.
>
> -Ruben- Hide quoted text -
>
> - Show quoted text -
Larry,
The code referenced in your response is just what I used for the
Windows Common Dialog. What I don't know is how exactly to use or
incor****ate this into the Shell function. Any specific ideas or
examples on what this would look like would be helpful and most
certainly appreciated.
Ruben


|