Results 1 to 4 of 4
  1. #1
    Cleave_1b is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    27

    Avoiding security boxes on opening an .mp4 recording.

    I have one tutorial built into an application and want a user to be able to view it immediately upon clicking on it's icon. There are a couple of security warning that show up, though, and I haven't figured out how to avoid them. After all, there are recordings in the same folder as the call button!

    I'm currently opening the red=cording with
    Application.FollowHyperlink CurrentProject.Path & "\Tutorials\Tutorial_Residents.mp4"



    Suggestions?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Try this method instead, place this code into a module and it will open the file in its native app, maybe without security.
    it will open ANY file in its native application.

    usage: OpenNativeApp "c:\folder\file.pdf"
    will open it in acrobat
    and
    OpenNativeApp ME.txtBox
    will open the .mp4 in media player or whatever is assigned to play movies.

    Code:
    'Attribute VB_Name = "modNativeApp"
    'Option Compare Database
    Option Explicit
    
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpszOp As String, ByVal lpszFile As String, ByVal lpszParams As String, ByVal lpszDir As String, ByVal FsShowCmd As Long) As Long
    
    Private Declare Function GetDesktopWindow Lib "user32" () As Long
    Const SW_SHOWNORMAL = 1
    Const SE_ERR_FNF = 2&
    Const SE_ERR_PNF = 3&
    Const SE_ERR_ACCESSDENIED = 5&
    Const SE_ERR_OOM = 8&
    Const SE_ERR_DLLNOTFOUND = 32&
    Const SE_ERR_SHARE = 26&
    Const SE_ERR_ASSOCINCOMPLETE = 27&
    Const SE_ERR_DDETIMEOUT = 28&
    Const SE_ERR_DDEFAIL = 29&
    Const SE_ERR_DDEBUSY = 30&
    Const SE_ERR_NOASSOC = 31&
    Const ERROR_BAD_FORMAT = 11&
    
    
    Public Sub OpenNativeApp(ByVal psDocName As String)
    Dim r As Long, msg As String
    
    r = StartDoc(psDocName)
    If r <= 32 Then
        'There was an error
        Select Case r
            Case SE_ERR_FNF
                msg = "File not found"
            Case SE_ERR_PNF
                msg = "Path not found"
            Case SE_ERR_ACCESSDENIED
                msg = "Access denied"
            Case SE_ERR_OOM
                msg = "Out of memory"
            Case SE_ERR_DLLNOTFOUND
                msg = "DLL not found"
            Case SE_ERR_SHARE
                msg = "A sharing violation occurred"
            Case SE_ERR_ASSOCINCOMPLETE
                msg = "Incomplete or invalid file association"
            Case SE_ERR_DDETIMEOUT
                msg = "DDE Time out"
            Case SE_ERR_DDEFAIL
                msg = "DDE transaction failed"
            Case SE_ERR_DDEBUSY
                msg = "DDE busy"
            Case SE_ERR_NOASSOC
                msg = "No association for file extension"
            Case ERROR_BAD_FORMAT
                msg = "Invalid EXE file or error in EXE image"
            Case Else
                msg = "Unknown error"
        End Select
    '    MsgBox msg
    End If
    End Sub

  3. #3
    Cleave_1b is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    27
    Finally got a chance to try it out. I get a
    Sub of Function not defined on

    r = StartDoc(psDocName)

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    according to your detail, you are using 64bit Access. The example ranman suggested is for 32bit. But easily fixed, change the declaration to

    Private Declare PtrSafe Function ShellExecute...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 10-23-2011, 06:34 AM
  2. Recording UserName Login
    By Moonsitter53 in forum Access
    Replies: 1
    Last Post: 03-18-2011, 02:40 PM
  3. Recording your own Macro
    By sabre1 in forum Access
    Replies: 1
    Last Post: 03-02-2011, 06:43 AM
  4. Recording Username
    By Juan4412 in forum Forms
    Replies: 9
    Last Post: 02-01-2011, 11:15 PM
  5. time recording
    By Back2Basics in forum Access
    Replies: 3
    Last Post: 02-02-2010, 08:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums