Approach User Support homepage Approach User Support
Answers to Frequently Asked Questions about Lotus Approach
Examples LotusScripts
Example databases
Links to other Lotus Approach support services

[Return to contents]

Example LotusScript: Loading a document into some other application

Last updated: 12 Jul 2002

(Contributed by "David Legge" <dave.legge@lineone.net>)

It is possible to 'tell MS-Windows' to load a document into its default application for any file type recognised by windows using the Shell command. Eg.

x = Shell("rundll32.exe url.dll,FileProtocolHandler d:\clipart\acs.pcx")

To make like simple you might like to imbed the command in a script like the following:

Sub Loadfile( Filename as string)
dim intRtn as integer
On Error Goto ErrTrap
intrtn  = Shell("rundll32.exe url.dll,FileProtocolHandler " & Filename)
ExitSub
ErrTrap:
  'Non-specific handler
  Msgbox "Error " & Format$(Err, "#0") & " - message: " & Error$, 16,"System
Error"
  Resume Next
End Sub

[Return to contents]

© Copyright, JohnBrown, Trademarks, Disclaimer, Acknowledgements.