Print a created publisher document using vba

wackywoo105

Registered User.
Local time
Yesterday, 17:19
Joined
Mar 14, 2014
Messages
203
I can create a publisher document and add info:

Code:
Dim appPub As Publisher.Application
Dim pubDoc As Publisher.Document
Dim pubShape As Publisher.Shape

Set appPub = New Publisher.Application
Set pubDoc = appPub.Open(MydocTemp)

On Error Resume Next
pubDoc.Pages(1).Shapes("Text Box 319").TextFrame.TextRange.Text = Date

The problem comes when I want to print it. I would like to select a certain printer and a certain paper tray. I would also like to select boarder-less printing.

For a report I use the following (doesn't included boarder-less)

Code:
        DoCmd.OpenReport strReport, acViewPreview, , _
        strCrit ', acHidden
    
        Set rpt = Reports(strReport)
        With rpt
            Set .Printer = Application.Printers(iSelectedPrn)
            If Brother = True Then .Printer.PaperBin = 258 ' which paperbin if brother 258=MP Tray
        End With
        DoCmd.PrintOut
        DoCmd.Close acReport, strReport, acSaveNo

Is there something similar to this I could use to print an active publisher document and define the required settings?
 
Well I managed to sort a workaround.

I simply save the the publisher document I have created. I have created a duplicate of my printer and set it up boarderless and the correct paper tray. I then use command line to set this as default printer and the print the publisher doc. Command line 1 VBA nil.
 

Users who are viewing this thread

Back
Top Bottom