Alexander Peters wrote:
Hello!
I use OLE to connect to OpenOffice.org Writer and want to get Returncodes
from Macros which i execute with a dispatcher. How can i make this?
Or is there an other way to execute macros to get a returnvalue?
Any Codesnip in any language will help me.
Greetings
Alexander Peters
Alexander,
I am not sure I understand what you need (and seeing other reactions I am
not the only one), but maybe it is something like the following example:
Sub returnValueDemo
oDocument = ThisComponent
oSheet = oDocument.Sheets.getByName( "charts" )
oCharts = oSheet.Charts
sChartName = "abnam_d"
' Cindex = ChartN 'Get chart index
' oChart = oCharts(Cindex) 'either this way
oChart = oCharts( ChartN ) 'or this way
oEmbeddedChart = oChart.EmbeddedObject
oDiagram = oEmbeddedChart.Diagram
print ChartN
End Sub
Function ChartN 'This
only works as a function,
if sChartName = "aexin_d" then 'not as a Sub
ChartN = 1
elseif sChartName = "abnam_d" then
ChartN = 2
elseif sChartName = "aegon_d" then
ChartN = 3
elseif sChartName = "akzon_d" then
ChartN = 4
end if
End Function
It is more or less along the line given by Andrew Douglas Pitonyak
in his OpenOffice.org Macro document
<http://www.pitonyak.org/AndrewMacro.sxw> , e.g. sections 12.3 and 18.77
I hope this helps,
Sincerely,
Gerrit Jasper
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]