Problem with opening Publisher through code

G

Guest

Hi

I use the code below to open and print a publisher document on the click of
a button on one of my forms. I'm using Access 2000 and Publisher 2000.

I thought the code i had written should open the document and print it but
without opening over the access application. This is for one my clients and
they don't want their view of the access screen to be disturbed by publisher
opening over the top.

Can anyone tell me what i've done wrong in my code.

Dim stDocName As String
Dim strfile As String
Dim strShell As String

strfile = "C:\TBP_Sales\Particulars\" & Me.txtBU_Particulars & ".pub"


strShell = Chr$(34) & _
"C:\Program Files\Microsoft Office\Office\MSPUB.EXE" & _
Chr$(34) & " /p " & Chr$(34) & strfile & Chr$(34)
Shell strShell, vbHide

Thanks
 
G

Guest

Hi

Thanks for you reply but i'm slightly confused as to which part of the code
you sent me tells the program to be hidden.

Thanks
 
A

Alex Dybenko

Sorry, not sure you can run it as hidden with this code, perhaps you can run
with SW_SHOWNOACTIVATE and Print.
you can also open published via automation and open publication there and
then print
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top