| View previous topic :: View next topic |
| Author |
Message |
Anateus Newbie

Joined: 08 Dec 2004 Posts: 2
|
Posted: Wed Dec 08, 2004 11:32 pm Post subject: Delphi7 and OpenOffice Writer |
|
|
Hallo,
I program with Delphi7 an OOo Document.
I can select a printer with following source:
vPrinterParams := VarArrayCreate([0,7], varVariant);
vPrinterOps := VarArrayCreate([0,3], varVariant);
vCoreReflection := vSvcMgr.createInstance('com.sun.star.reflection.CoreReflection');
vCoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(vPropertyValue);
vPrinterParams:=vDoc.GetPrinter;
vPrinterParams[0].Value := Drucker_Name;
vPrinterParams[0].Name := 'Name';
vDoc.SetPrinter(vPrinterParams);
But I can't select a tray.
How can I select a tray with Delphi?
Can you help me?
Thanks.
Harald |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
|
| Back to top |
|
 |
Anateus Newbie

Joined: 08 Dec 2004 Posts: 2
|
Posted: Fri Dec 17, 2004 3:15 am Post subject: |
|
|
I have now insert the following source, but I become error with
EOleException "com.sun.star.uno.Exception.
What can I do?
vPrinterParams := VarArrayCreate([0,7], varVariant);
vPrinterOps := VarArrayCreate([0,3], varVariant);
vCoreReflection := vSvcMgr.createInstance('com.sun.star.reflection.CoreReflection');
vCoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(vPropertyValue);
vPrinterParams:=vDoc.GetPrinter;
vPrinterParams[0].Value := Drucker_Name;
vPrinterParams[0].Name := 'Name';
//------------------
sPageFirst:= 'First Page';
sPage:= 'Standard';
oPageStyleFirst:= vDoc.StyleFamilies.GetByName('PageStyles').GetByName(sPageFirst);
oPageStyle:= vDoc.StyleFamilies.GetByName('PageStyles').GetByName(sPage);
sTray := 'Tray 3';
oPageStyleFirst.PrinterPaperTray:= sTray;
oPageStyle.PrinterPaperTray:= sTray;
//------------------
vDoc.SetPrinter(vPrinterParams); |
|
| Back to top |
|
 |
|