Stuart McLachlan
stuart at lexacorp.com.pg
Sun Jun 7 19:24:37 CDT 2009
Just been working on another system where I needed to open various types of documents. Application.Followhyperlink is taking up to 30 seconds before it throws up a warning message box about the risk of infected files and then finally lets me open the file. ShellExecute() opens instantaneously. Guess I'll go back to using ShellExecute :-0 For those who are interested, here's the ShellExecuteI() requirements: One declaration In my general functions module: Public 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 One line in my form's code: ShellExecute Application.hWndAccessApp, "Open", strName, "", "", vbNormalFocus -- Stuart On 6 Jun 2009 at 7:20, Stuart McLachlan wrote: > Darn it! How long's that been around. > > I've always used a call to ShellExecute() when I needed to do this. :-( > > FollowHyperlink is much simpler. > > > -- > Stuart > > On 5 Jun 2009 at 13:47, Rocky Smolin wrote: > > > OK, never mind, I found it - Application.FollowHyperlink seems to do it. > > Too easy. > > > > Rocky > > > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin > > Sent: Friday, June 05, 2009 1:42 PM > > To: 'Access Developers discussion and problem solving' > > Subject: [AccessD] Pick a file, any file > > > > Dear List: > > > > I have a client who wants a list of file attachments as children to a parent > > table. No problem. I get the path and file names using the open file > > dialog box. > > > > But now he wants to be able to click the attachment text box (it contains > > path and file name), and open the file with whatever program should open it > > - .doc/.docx with word, .pdf with acrobat, .xls with Excel, .jpg with > > whatever he's go it associated with, and any other file regardless of > > extension (based perhaps on the association?). > > > > Is there a way to general case this without knowing what application should > > be used to open the attachment and exactly where the application is located? > > > > MTIA > > > > > > > > Rocky Smolin > > > > Beach Access Software > > > > 858-259-4334 > > > > www.e-z-mrp.com <http://www.e-z-mrp.com/> > > > > www.bchacc.com <http://www.bchacc.com/> > > > > > > > > > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com