Kamis, 12 April 2012

RE: [MS_AccessPros] When referenced programs are updated

 

Adam

Here is how you do it using an API call:

'This goes in a standard module Declaration area.

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

'Window Constants

Public Enum WinMode

WIN_NORMAL = 1

WIN_MIN = 2

WIN_MAX = 3

End Enum

Function LaunchOpen(strFile As String, lShowWin As Long)

Dim lRet As Long

lRet = ShellExecute(hWndAccessApp, vbNullString, _

strFile, vbNullString, vbNullString, lShowWin)

End Function

Call LaunchOpen this way:

Call LaunchOpen("YourPDFfilepath", WinMode.Win_Normal)

Regards,
Bill Mosca,
Founder, MS_Access_Professionals
That'll do IT <http://thatlldoit.com/> http://thatlldoit.com
MS Access MVP
<https://mvp.support.microsoft.com/profile/Bill.Mosca>
https://mvp.support.microsoft.com/profile/Bill.Mosca

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of AdamF
Sent: Thursday, April 12, 2012 2:00 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] When referenced programs are updated

I open pdf files by first referencing the Acrobat program. However, when that
program is upgraded, I have to change to code.

stApp = "C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe"
stFile = "H:\JarDrawings\" & stFolder & "\" & Me.BaseJar & ".pdf"
Call Shell(stApp & " " & stFile, 4)

Is there a better way to do this to automatically account for upgrades (in this
case Reder 9.0 to 10.0), of when different users have different versions?

Adam
Denver, CO

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar