Principal | Enlaces | PDI's para TOM TOM | Foro | Tapices
 
 
Trucos de Windows.
Trucos de Office.
Trucos de Hardware.
Trucos de Internet.

Códigos VB.

Códigos JavaScript.
Códigos HTML.

 
Página 1 de 9
Abrir Archivo o página Web
'******************************************************************************************************
'**********************************************En un Form******************************************
'**************************************************
**************************************************** 

Private Sub Form_Load()
Dim X As Long
'Para abrir cualquier archivo
X = ShellExecute(Me.hwnd, "Open", "C:\Mis documentos\archivo.doc", "", "c:\", 1)

'Se puede usar para enviar un correo
'X = ShellExecute(Me.hwnd, "Open", "mailto:lmbeber@lucasnet.com.ar", "", "c:\", 1)

'O abrir una página Web
'X = ShellExecute(Me.hwnd, "Open", "http://lucasnet.com.ar", "", "c:\", 1)
End Sub

'*********************************************************************************************************
'**********************************************En un Módulo*******************************************
'*********************************************************************************************************

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

Const SW_HIDE As Long = 0
Const SW_SHOWNORMAL As Long = 1
Const SW_SHOWMINIMIZED As Long = 2
Const SW_SHOWMAXIMIZED As Long = 3
Const SW_SHOWNOACTIVATE As Long = 4
Const SW_SHOW As Long = 5
Const SW_MINIMIZE As Long = 6
Const SW_SHOWMINNOACTIVE As Long = 7
Const SW_SHOWNA As Long = 8
Const SW_RESTORE As Long = 9
Const SW_SHOWDEFAULT As Long = 10


Cerrar Microsoft Internet Explorer

'******************************************************************************************************
'*******************En un Form con un botón de nombre Command1**************************
'****************************************************************************************************** 

Private Sub Command1_Click()
'El programa tiene que estar activo sino da error
AppActivate "Microsoft Internet Explorer"
SendKeys "%{F4}", True
End Sub


Página 1 de 9
 
 
Principal | Enlaces | PDI's para TOM TOM | Foro | Tapices
© TrucoMania.eu
 
Todos los derechos reservados, 2007