http://openoffice.org/bugzilla/show_bug.cgi?id=117783

        Issue Type: DEFECT
           Summary: Printer properties ignored from macros
    Classification: Code
           Product: framework
           Version: OOo 3.3
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: code
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]


This macro prints a Write document. The document should print two pages per
sheet in Landscape mode. The document prints normally. Note that this is a
regression issue.

Sub PrintTwoPerPage
  Dim Props(0 To 1) As New com.sun.star.beans.PropertyValue
  Props(0).Name = "PageColumns" : Props(0).Value = 2
  Props(1).Name = "IsLandscape" : Props(1).Value = True
  If HasUnoInterfaces(ThisComponent, "com.sun.star.text.XPagePrintable") Then
    ThisComponent.setPagePrintSettings(Props())  '
    ThisComponent.printPages(Array())            'Use default properties
  Else
    Print "Sorry, this document does not support the XPagePrintable interface"
  End If
End Sub

Does the macro look familiar? The macro worked when this bug was fixed five
years ago!

http://openoffice.org/bugzilla/show_bug.cgi?id=23411 

Note that I also tried this variant

Sub PrintTwoPerPage_second_try
  Dim Props
  Props = ThisComponent.getPagePrintSettings()
  For i = 0 To UBound(Props)
    If props(i).Name = "PageColumns" Then
      props(i).value = 2
    ElseIf props(i).Name = "IsLandscape" Then
      props(i).value = True
    End If
  Next
  ThisComponent.setPagePrintSettings(Props())
  ThisComponent.printPages(Array())
End Sub

In the deep dark recess of my mind, I keep thinking that Philipp Lohmann is
aware of this problem and may even be working on it.

-- 
Configure bugmail: http://openoffice.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification
from Bugzilla. Please log into the website and enter your comments.
---------------------------------------------------------------------
-- 
-----------------------------------------------------------------
To unsubscribe send email to [email protected]
For additional commands send email to [email protected]
with Subject: help
-- 
-----------------------------------------------------------------
To unsubscribe send email to [email protected]
For additional commands send email to [email protected]
with Subject: help

Reply via email to