In Response to: Ian Laurenson,

The code listed below didn't work when I tried it. The original XL file
has 2 sheets setup and this code prints out the whole of the second
sheet. I can see that the area on the first sheet gets highlighted ie.
selected, but it doesn't printout. 

>> '     ActiveWorkbook.Save
>> thisComponent.store
Thanks for this bit - seems to work fine. Much appreciated. As simple
as the VBA code - yay!!

>> By the way, I think your subject for this posting is wrong. The
macro
>> language BASIC is close to identical between OOo BASIC and VBA. The
>> underlying object models (APIs) are very different.

Yes, I do agree with you on this although I do feel that the object
model is the way most people would see the language ie. although it is
an extension of it, it is a pretty critical one. Not sure what would be
involved in changing the languages interface to the object model or
even if it can be done but it certainly would be welcomed. 

>> In defence of the OOo API:
>> I can do things that were virtually impossible with Microsoft Office
>> (MSO). For example, my "reveal codes" macro simply wouldn't be
possible
>> in MSO.

But intruth for 99.9% of users this level of power and sophistication
is not required and it comes at a price.

>> The API is designed to be accessible from a wide range of languages.

Which are all incomprehensible to the average user.

>> My attempt at a solution has been to put together the wiki
>> http://ext.openoffice.org.nz. In that wiki I and others have written
>> functions (together with documentation) that people can copy and
paste
>> into their own macros. Eventually I hope that we will have a
sufficient
>> library of routines that writing macros for OOo is at least as easy
as
>> it is in VBA.

VERY much appreciated. Can't something like this be integrated into the
language - I gather that the UNO stuff is on these lines but what you
are doing seems like what is needed. 

If I ever get good enough at this to write anything useful, I'll add to
your Wiki, whats a Wiki?

Regards

Chris

>> Here is an alternative bit of code, with the original code left as
>> comments:
>> 
>> sub Monday
>> oCurController = ThisComponent.CurrentController
>> oActiveSheet = oCurController.ActiveSheet      
>> 
>> '     Range("A47:AL126").Select
>> oCurController.select(oActiveSheet.getCellRangeByName("A1:B3"))
>> 
>> '     Selection.PrintOut Copies:=1, Collate:=True
>> dim mPrintProperties(1) as new com.sun.star.beans.PropertyValue
>> mPrintProperties(0).name = "Copies"
>> mPrintProperties(0).value = 1
>> mPrintProperties(0).name = "Collate"
>> mPrintProperties(0).value = true
>> oActiveSheet.setprintareas(ocurController.getSelection)
>> thisComponent.print(mPrintProperties())
>> 
>> '     ActiveWorkbook.Save
>> thisComponent.store
>> end sub
>> 



                
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new Resources site
http://smallbusiness.yahoo.com/resources/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to