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]

Using a macro or Script to open documents in other applications

Last updated: 21 Dec 1999

To opening a WordPro to a particular document from Approach, just create a macro with an OPEN command, and enter the path and filename of the WordPro document.

However, there is a problem with the OPEN command in that it gives an error if you have a space in the path or file name. To get around this, create a one line global LotusScript using the OpenDocument method to open the WordPro file. You can then run the sub LotusScript with the macro Run command if you like. An example LotusScript is:

Sub TestLWPOpen
'Contributed by Paul Bent XpertSS.com
    Dim LWPApp As Variant
    Set LWPApp = CreateObject("WordPro.Application")
    LWPApp.Visible = True
    Call LWPApp.OpenDocument("test doc.lwp", "c:\temp\")
End Sub

If you don't /can't use LotusScript, or need to do something a little more complicated, then consider using a DOS batch file which calls WordPro (or any other applications or applications) with the filename as a parameter. To do this, simply put the following line in a plain text file that has a .bat filename extension (eg. mybatch.bat) where 'f:\rescon\letter.lwp' is the path and filename of the WordPro document you wish to open:

c:\lotus\wordpro\wordpro.exe f:\rescon\letter.lwp

Then create a macro in Approach that calls the .bat file with the 'open' command:

OPEN c:\batch\letter.bat

[Return to contents]

© Copyright, JohnBrown, Trademarks, Disclaimer, Acknowledgements.