[Solved] Use CreateUnoService in C#

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
Lumberjack
Posts: 13
Joined: Thu Jan 28, 2021 4:02 pm

[Solved] Use CreateUnoService in C#

Post by Lumberjack »

 Edit: Split from topic 107589 because you have introduced a new subject. Please review our forum policy: One issue, one thread. I have split your posts for you. But you should not put unrelated questions in one topic. Questions are not related simply because they come from you.. 
Thanks for response.

I try to implemenet solution from Useful Macro Information For OpenOffice By Andrew Pitonyak book. Unfortunatly all of it is in Visual Basic code. I need create code in c# language.
Now i have problem with create uno service .

Code: Select all

createUnoService("com.sun.star.graphic.GraphicProvider")
How do this in C#? I don't have function createUnoService.
Last edited by MrProgrammer on Tue May 03, 2022 11:55 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
OpenOffice 3.1 on Windows Vista
User avatar
MrProgrammer
Moderator
Posts: 4905
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Use createUnoService in C#

Post by MrProgrammer »

Lumberjack wrote:How perform createUnoService("com.sun.star.graphic.GraphicProvider") in C#?
Instantiating UNO Services says you can use createInstance() instead of CreateUnoService(). CreateUnoService is a special function for Basic.

Most macro programming is done in Basic or Python. If you want to work in a different language, study the Developer's Guide:
First Steps
Using Services

Perhaps you can find some examples on the forum to help you understand the concepts. If you try to write macros created by copy/paste without understanding the concepts, you are unlikely to be successful. One place to look for a C# example would be Code Snippets. If you do not find one there, it would be helpful if you add your working example to that forum so others can benefit from your knowledge.

I do very little macro programming. I've directed you to the relevant documentation and am done helping here. Good luck.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Use CreateUnoService in C#

Post by Villeroy »

http://www.kalitech.fr/clients/doc/VB_A ... irst_steps describes first steps in VB but you might be able to transfer VB into C#.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply