🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.pl.openoffice
Article #57

Re: Makro

#57
From: qaziq
Date: Tue, 15 Apr 2003 14:05
59 lines
2813 bytes
> Jak powinno wyglądac makro za pomocą którego mozna będzie przełączać styl
> skrótem klawiatury? tzn. przyciskam np ctrl+a i mam styl Nagłówek1, a
potem
> ctrl+s i mam styl standardowy.

poniżej znajduje się listing makra

zrobione na angielskiej wersji, więc może będzie konieczna zmiana nazw
stylów, makro podpinasz pod skrót klawiaturowy w wersji angielskiej tak:
tools -> macros -> macro -> assign / w polskiej oczywiście trzeba
przetłumaczyć ;) /

pozdrawiam
    rTarnawa

sub heading
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("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Template"
args1(0).Value = "Heading 1"
args1(1).Name = "Family"
args1(1).Value = 2

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


end sub


sub default
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("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Template"
args1(0).Value = "Default"
args1(1).Name = "Family"
args1(1).Value = 2

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


end sub
Technical Details
Message-ID: <b7h3jf$d72$1@news.onet.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!news.ipartners.pl!news.internetia.pl!newsfeed.gazeta.pl!news.onet.pl!not-for-mail
References: <b7gf8k$okg$1@inews.gazeta.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!news.ipartners.pl!news.internetia.pl!newsfeed.gazeta.pl!news.onet.pl!not-for-mail
From: "qaziq" <qaz75@wp.pl>
Newsgroups: alt.pl.openoffice
Subject: Re: Makro
Date: Tue, 15 Apr 2003 16:05:35 +0200
Organization: news.onet.pl
Lines: 61
Sender: rtarnawa@poczta.onet.pl@gro.dtvk.tpnet.pl
Message-ID: <b7h3jf$d72$1@news.onet.pl>
References: <b7gf8k$okg$1@inews.gazeta.pl>
NNTP-Posting-Host: gro.dtvk.tpnet.pl
X-Trace: news.onet.pl 1050415535 13538 212.160.79.187 (15 Apr 2003 14:05:35 GMT)
X-Complaints-To: abuse@onet.pl
NNTP-Posting-Date: 15 Apr 2003 14:05:35 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit