[AccessD] Access 2013 - open WPS files?
Tina Norris Fields
tinanfields at torchlake.com
Sat Oct 3 16:07:20 CDT 2015
Aha! Exactly what I should have though about - the associated
application. Thank you, Stuart! Grabbing your code right this instant.
TNF
Tina Norris Fields
tinanfields-at-torchlake-dot-com
231-322-2787
On 10/03/15 2:04 AM, Stuart McLachlan wrote:
> You can open any file which has an assocated application from within Access.
>
> As long as the .wpd (or whatever) extension is associated with WP, just pass the full file
> path/name to the function below and it will open in WP.
>
> 'Best to place this declaration in a stand alone module
> 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
>
>
> 'I oftern call the following function from the DoubleClick event of a textbox which shows the
> filename.
>
> Function OpenFileInApplication(Filename as string) as long
> 'Opens any file in its assocated application
>
> If (Dir$(Filename) > "") Then
> ShellExecute Application.hWndAccessApp, "Open", Filename, "", "", vbNormalFocus
> Else
> MsgBox FileName & " not found!"
> OpenFileInApplication = 1
> End If
>
> End Function
>
More information about the AccessD
mailing list