Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word Mailmerge controlled from Access - Printer Info

Status
Not open for further replies.

Julesatwork

Technical User
Jan 30, 2002
10
GB
Hi There

I am writing an app in MS Access 2000 which simply prints out inserts for a product containing details, barcode etc to a Xerox printer.

Because of formatting issues I am using word mailmerge documents (there is only 1 record being merged)

The users select their product from an access form which contains all the product info to be printed along with the template to open. They want it to run seamlessly, dont want to preview just simply print.

I have this working fine to a point with the following code;

Dim oApp As Word.Application
Dim oDoc As Word.Document
Dim mydoc As Word.Document
'Start a new document in Word
Set oApp = New Word.Application
'The path & file name will be a variable when completed
Set oDoc = oApp.Documents.Open (C:\Test2UTT.doc")

'Make Word invisible
oApp.Visible = False

'Proceed with mail merge
oDoc.MailMerge.Execute Pause:=False

'Close Main Document
oDoc.Close SaveChanges:=wdDoNotSaveChanges
'Print out new document
'oApp.ActiveDocument.PrintOut Background:=False
'Close New Document
oApp.ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
'Quit Word
oApp.Quit

My problem is I also need to specify a specific printer and printer bin. I know I can specify No of copies using Printout but how do I parse this additional info.

Any advice on how I might do this would be appreciated bearing in mind the users dont want to see word at all.

Frustrated - Spent hours searching Microsoft & other forums!!!

Thanks in anticipation

Jules
 
Jules,

You should be able to do something that simple in a report inside Access.

As to the specific bins, you can use the report settings which should get saved.

Why do you think mailmerge would be better?
 
Thanks so much for getting back to me!

Yes, I wish I could of used simple access reports which initially I had planned to do. Basically, I am upgrading an existing Access 2 and old word templates to Office 2000. The existing app uses these word templates (29) which after reviewing I realised why. There is lots of specific formatted text, bullets etc which I guess I could achieve in Access with a lot of fiddly work but the users also want the ability to create new templates which I figure they can do far more easily through word than Access reports. If they were straight forward - no probs! So thats the reasoning behind staying with the word documents! Do you agree?

Some background on the documents - These are 1 page documents which when printed are card inserts to go in product packaging. The document is not specific to a printer or printer tray - they have different backing cards dependent on the Customer so there might be 12 types of backing card to print the document on. They fill whichever tray they like in whichever printer(2). Therefore they need to point it to a printer & tray when selecting print. They also want to have the facility to print bulk jobs i.e. select a series of products, assign them to the relevant printer, tray, no of copies and then leave the print job running (this I know I can do once I get it working for 1)
So that means I cant assign the printer and tray in the actual document. Ohhh this is so long winded - Sorry!

An idea I had which may work but may not be the best way to do it is to use the following in my code

Define using a case select the bin & printer they wish to use then
e.g.

oapp.ActivePrinter = strPrinter

oApp.ActiveDocument.PageSetup.FirstPageTray = wdPrinterLowerBin

oApp.ActiveDocument.PrintOut Background:=False

Because there is only 1 page for the document this should work???? What do you think? Unfortunately, I cant test this until I am on-site on Monday but in theory it should work.

Any feedback greatly appreciated!

Jules

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top