Knowledge learned from Access-VBA development (III.)

Source: Internet
Author: User

Open a file or program


' API function declaration
Public Declare Function ShellExecute Lib "Shell32.dll" Alias "Shellexecutea" (ByVal hWnd as Long, ByVal lpoperation as Str ING, ByVal lpfile As String, ByVal lpparameters as String, ByVal lpdirectory as String, ByVal nShowCmd as long) as long


' ShellExecute function two times package to simplify use
' Input parameter file can be a file name, Web address or command line
Public Function ShellEx (File as String)
ShellExecute hWndAccessApp, "Open", File, 0, 0, 1
End Function

Use the hWndAccessApp method to determine the handle that Microsoft Windows assigns to the Microsoft Access main window.

Expression.hwndaccessapp

expression Required. Returns an expression for an object in the "Applies to" list.

Description

The hWndAccessApp method returns a read-only long Integer value set by Microsoft Access.

You can use this method with visual Basic when you call Windows Application Programming Interface (API) functions or other external procedures that require window handles as parameters.

To get a handle to a window with a Microsoft Access object such as form or report, you can use the HWND property.

Knowledge learned from Access-VBA development (III.)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.