martin2k

Google
 
Web www.martin2k.co.uk

Reg:Automization using Visual Basic


Home Read and add posts to the Visual Basic 6.0 Forums Download some of my programs and OCXs Read the Tips here The old style forum is still available here Contact

Back


From: Sathish.S.Kutty E-mail: sathish.external@infineon.com 1

Date: Monday, June 18, 2001 at 14:41:44

Subject: Reg:Automization using Visual Basic

Comments:

I need to know the coding to link an
AcrobatWriter from the command button
on the Visual Basic program..

Your suggestions and guidance in this regard
would be of immense help

Thanks and Bye
Sathish

From: Martin Allen E-mail: <No e-mail> 2

Date: Tuesday, June 19, 2001 at 23:04:51

Subject: RE: Reg:Automization using Visual Basic

Comments:

The easiest way to run any file that is not a program is to use the ShellExecute API function.  Put the following code into a module:

Public Const SW_SHOW = 1

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

You can now use the following command in your program:

ShellCode = ShellExecute(Me.hWnd, "open", "C:\Files\Document.pdf", "", "", 1)

This will return the PID (if it equals 0, the command has been unsuccessful).


This forum is no longer taking new messages or replies since 01 November 2002.  The above material is for reference purposes only.

The new Visual Basic 6.0 forum can be found here.


Martin Allen 1999 - 2003.  Last updated Monday 12 May 2003 08:00:18 PM +0100.