README.md

December 4, 2022 ยท View on GitHub

Open File With Default Editor or Program

Description

This 1 line of code will Open any file with their correct default program. EX: opens .Doc file with winword and .Zip file with WinZip..Or any file with their default program..

More Info

Submitted On
ByTyler
LevelBeginner
User Rating4.9 (34 globes from 7 users)
CompatibilityVB 4.0 (32-bit), VB 5.0, VB 6.0
CategoryFiles/ File Controls/ Input/ Output
WorldVisual Basic
Archive File

API Declarations

Private 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

Source Code

Private Function openfile(file As String)
Call ShellExecute(0&, vbNullString, file, vbNullString, vbNullString, vbNormalFocus)
End Function
'' That's it!..
'' Please Vote..:-)