Problem with opening Publisher through code

G

gdonald20

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

gdonald20

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
 
Top