bladeware General User

Joined: 02 Apr 2008 Posts: 11
|
Posted: Wed Apr 02, 2008 10:08 am Post subject: Lotus Script and createEnumeration (Solved) |
|
|
Solved. Silly me I did not have the braces () on the createEnumeration
I am new to this forum, and have tried searching, but I guess not has been posted much with Notes/Domino and using Open Office.
All I am trying to do is find the tables listed in a document. When I find the tables, I want to find out how many columns there are.
I have copied/pasted some code and this does open the document, but all the lines marked are getting an Object Variable not set.
Note: All I wanted to do was read the elements in the document.
Note: Lotus Script is similiar to VB
Thanks to all. John
Dim objServiceManager As Variant
Dim objCoreReflection As Variant
Dim objDesktop As Variant
Dim objText As Variant
Dim objDocument As Variant
Dim args() As Variant
'-- Create the Objects to handle the document
Set objServiceManager = CreateObject("com.sun.star.ServiceManager")
Set objCoreReflection= objServiceManager.createInstance("com.sun.star.reflection.CoreReflection")
Set objDesktop = objServiceManager.createInstance("com.sun.star.frame.Desktop")
Set objDocument = objDesktop.loadComponentFromURL("file:///C:/"+"table"+".sxw", "_blank", 0, args)
Dim oTextEnum As Variant
Dim oTextElement As Variant
Set objText = objDocument.getText()
Set oTextEnum = objDocument.Text.createEnumeration 'did not work
Set oTextEnum = objText.Text.createEnumeration 'did not work
Set oTextEnum = objText.createEnumeration 'did not work
' Never hits the below code
While oTextEnum.hasMoreElements()
oTextElement = oTextEnum.nextElement()
Msgbox "Here I am"
Wend
Call objDocument.close( True ) |
|