Python, win32com, lotus123

brix22 at my-deja.com brix22 at my-deja.com
Wed Nov 22 05:34:19 CET 2000


In article <eBZR5.63133$a7.1106848 at news1.rdc1.il.home.com>,
  "Larry Whitley" <ldwhitley at home.com> wrote:
> What I'm trying to do is to
> use win32com to interface to Lotus 123 to generate some nice
printable and
> viewable graphs.  I've managed to start 123 program and make it
visible but
> need some pointers on how to put the data into Lotus and generate and
print
> graphs.  I assume that there is some Lotus documentation that I'm
missing -
> can someone point me in the right direction?  Or perhaps tell me what
I
> should be looking for?

Following up on your example, here's some code to open a window on the
document and enter some text in a range.

import win32com.client
ssDoc = win32com.client.Dispatch( "Lotus123.Workbook" )
ssDoc.Parent.Visible = 1
print ssDoc.Author
docWindow = ssDoc.NewDocWindow()
ssDoc.Ranges("A:A1").Contents = "foo"

It's been about four years since I've worked in the SmartSuite object
models extensively, but the main tips for figuring them out are ...

(1) Use the record feature to get 1-2-3 to create LotusScript code for
you.
(2) The resulting code often uses shortcuts which can't be accessed
through automation.  Use the "Browser" in the Script Editor to look
through the list of available classes to figure out what object "owns"
the object you are trying to work with.  That object will likely have
some sort of accessor method to let you get at the object you really
want (e.g. the Ranges method in the Document class).
(3) Make sure the LotusScript help files are installed.  They are not
by default.

- Doug


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list