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: Passing the contents of a field to Google.com

Last updated: 12 Jul 2002

"Tony Franks" <T.Franks@ccw.gov.uk> writes:

For all you folks out there who, like me, are Lotus Script virgins,
this is how you do the passing of field contents to Google.

First open your database and go into design.
Select the field in question and right click for "Field Properties".
Click on the "Macro" tab and note the contents of the "Object name"
box.
Close the "Field Properties" box.
Open the Script Editor [Ctrl+K], make sure the first box at the top
left corner says (Globals), then paste in the following:

Sub www
        Dim intRtn As Integer 
        Dim strURL As String, googleSearchString As String 
        strURL = "www.google.com/search?sourceid=navclient&querytime=iE&q="
        googleSearchString = currentview.body.ObjectName.text
        strURL = Lcase$(strURL) & googleSearchString
        intRtn = Shell("rundll32.Received: from CCW_Gateways-MTA exe url.dll,FileProtocolHandler" & strURL)
End Sub

In the line googleSearchString replace ObjectName for the content you
noted previously.
Make sure there is a space at the beginning of the google URL after the
first quotation mark (or it won't work!).
Create a button next to the field, and selecting the button right click
for "Field Properties".
Select the Macro tab, and click on "Define Macro", and Click on "New".
Give the macro a memorable name (eg "Google search for address").
Select the command "Run", and select the "radio button": Run macro.
Look in the dropdown list for "www" and select it.
Put a tick in the "Return to the next line in this Macro"
Click on [OK], Click on [Done] and save everything.
Test your Google search button!

Thanks are due to Paul Bent, Jerry Sikes, Keith Seeley, and Rainer
Schmid for all the help and encouragement!

[Return to contents]

© Copyright, JohnBrown, Trademarks, Disclaimer, Acknowledgements.