problem printin from a OO macro written in basic

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • iust
    New Member
    • Feb 2010
    • 1

    problem printin from a OO macro written in basic

    Hello!

    I have this problem with printing a document using a macro:

    sub printbutton

    ....
    for i = 1 to nrpag

    PrintDoc(i, i)

    next i
    ....

    end sub

    sub PrintDoc(ByVal ii as integer, jj as integer)
    ...
    Dim PrintProperty(1 ) as New com.sun.star.be ans.PropertyVal ue
    ...
    if ii <> jj then

    pagina = Cstr$(ii) & "-" & CStr$(jj)

    else

    pagina = CStr$(ii)

    end if
    rem MsgBox pagina
    PrintProperty(0 ).Name = "CopyCount"
    PrintProperty(0 ).Value = 1
    PrintProperty(1 ).Name = "Pages"
    PrintProperty(1 ).Value = pagina
    thisComponent.P rint(PrintPrope rty)

    end sub


    Now, my printbutton macro calls in a FOR the PrintDoc macro and:
    if I active that MsgBox the PrintDoc macro works well printing the two pages one after one.
    if I make it a commentary the macro prints only the first page.

    can someone tell me where is the problem, pls?
Working...