Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-14-2005, 11:00 AM   #1
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Debian "Testing"
Posts: 6,123

Rep: Reputation: 418Reputation: 418Reputation: 418Reputation: 418Reputation: 418
Simple Ooo BASIC Macro problem: "connot coerce argument type..."

Im using Openoffice 1.1.4, KDE3.3.2, Mandriva 2005LE, with updates. My java is jre1.5.0_04

I want a simple macro to insert some text into my document. For example:

Tools - Macro - Record
Type "test" <CR>
Mouse to Stop Recorder & stop it.
Save the macro as "Test"

When I run the macro I get:
BASIC runtime error.
An exception occurred
Message: cannot coerce argument type during corereflection call!
This is the code that Openoffice has generated for me:

REM  *****  BASIC  *****

Sub Main

End Sub

sub Test
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("")

rem ----------------------------------------------------------------------
dim args1(0) as new
args1(0).Name = "Text"
args1(0).Value = "test"

dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args1())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:InsertPara", "", 0, Array())

end sub
It falls over on the line:

dispatcher.executeDispatch(document, ".uno:InsertPara", "", 0, Array())

With the error I mentioned at the start.

Does anybody know what I have misconfigured?

Edit: misspelled the OOO error message

Last edited by tredegar; 08-27-2005 at 12:20 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
IPW2200 Make error macro "create_workqueue" passed 2 arguments, but takes just 1 jplev22 Linux - Wireless Networking 2 09-16-2005 12:34 PM
web surfing problem... i have to type in "http://" fatrandy13 Linux - Software 8 05-23-2005 03:48 AM
extern "C" and static data type problem with g++ vtluu Red Hat 1 05-21-2004 11:45 AM
extern "C" and static data type problem with g++ vtluu Programming 2 04-28-2004 06:10 AM
<input type="button" disabled="true" > does not work in ns4.7 or 4.9 cybercop12us Programming 2 11-29-2002 09:31 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:51 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration