kimgreg
Messages postés5Date d'inscriptionlundi 14 juin 2004StatutMembreDernière intervention30 août 2005
-
29 août 2005 à 15:38
kimgreg
Messages postés5Date d'inscriptionlundi 14 juin 2004StatutMembreDernière intervention30 août 2005
-
30 août 2005 à 10:59
Bonjour à tous,
Je voudrais savoir comment en vb on peut demander d'agrandir ou reduire la taille d'un document openoffice (sans cliquer sur les boutons en haut à droite de l'ecran !!
kimgreg
Messages postés5Date d'inscriptionlundi 14 juin 2004StatutMembreDernière intervention30 août 20052 30 août 2005 à 10:59
Merci pour la reponse !!
Finalement j'utilise une API suivante qui permet d'agrandir ou reduire une fenetre quelconque.
' Fonction permetant de reduire ou agrandir la fenetre dont le hWnd correspond
Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
' Fonction permettant de trouver le hWnd d'une fenetre en fonction de son titre
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
.
.
.
sub mon_bouton()
'Je recupere le hWnd de ma fenetre
hcalc = FindWindow(vbNullString,"toto.sxw - OpenOffice.org 1.1.4 ")
' J'agrandi ma fentre -> 3
hParent = ShowWindow(hcalc, 3)
michelxld
Messages postés402Date d'inscriptionvendredi 6 août 2004StatutMembreDernière intervention12 octobre 200832 29 août 2005 à 19:16
bonjour
tu peux tester cette macro
Sub redimensionnerFenetre_OOo()
Dim ServiceManager As Object
Dim Desktop As Object, Document As Object
Dim Args()
Dim X As Object
Set ServiceManager = CreateObject("com.sun.star.ServiceManager")
Set Desktop = ServiceManager.createInstance("com.sun.star.frame.Desktop")
'creation d'un document Writer
Set Document = Desktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, Args)
'prise en compte de la 1ere fenetre OOo ( index=0 )
Set X = Desktop.getFrames().getByIndex(0).getContainerWindow()
'redimensionne la fenetre
'Left - Top - Width - Height
X.setPosSize 0, 50, 700, 500, 15