Hallo Jan,

Danke für die Antwort.
Das schließen des Formulars geht, aber das speichern vorher nicht.

Gruß

Siegfried

----- Original Message ----- From: "Jan-Christian Wienandt" <[email protected]>
To: <[email protected]>
Sent: Monday, March 19, 2012 9:38 PM
Subject: AW: Base Macro


Moin Siegfried,

ich programmiere das Schließen eines Formulars so:

Dim oformular As Object
Dim odispatcher As Object

oformular = thisComponent.CurrentController.Frame
odispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
 odispatcher.executeDispatch(oformular, ".uno:CloseDoc", "", 0,Array())

Ab Version 3.0 von OO-Base kannst Du auch dies nutzen:

ThisDatabaseDocument.FormDocuments.getbyName( "Name des Formulars" ).close


Hier ist ein Link auf meine Homepage mit einer Datenbank zu
Formularfunktionen:

http://www.wienandt.de/seiten/dbmakro.htm


Gruß
Jan-Christian



-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]]
Gesendet: Montag, 19. März 2012 11:42
An: [email protected]
Betreff: Base Macro

Hallo
Ich möchte auf ein Formular in Base, wo neue Adressen angelegt werden einen
butten mit eeinen Makro hinterlegen, das den Datensatz Speichert und das
Formular dann schließt.
Mein Macro weißt aber irgenwo einen Fehler auf.


sub Formular_Speichern_u_Schliessen
rem ----------------------------------------------------------------------
rem Formular Speichern
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 Formular schliessen
----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:RecSave", "", 0, Array())
FormularAnmeldungSchliessen
ThisDatabaseDocument.FormDocuments.getByName("Neue_Einrichtung_eingeben").cl
ose
END SUB

kann mir einer helfen

siegfried


---------------------------------------------------------------------

Abmelden von der Mailingliste: [email protected]
Informationen: http://www.openoffice.org/de/

To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------

Abmelden von der Mailingliste: [email protected] Informationen: http://www.openoffice.org/de/

To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Antwort per Email an