I've run into more problems with my Access 2007/Merge Mail (Word 2007) application - refer my previous question. Everything within the Access /Mail Merge is working fine however the users asked if they could set one of several printers as the default printer from Access 2007 so when they sent the merged document to the default printer it would send the document to the printer they had designated as the default printer. When the application is started it builds a local table (working fine) of the printers installed on their PC which I uses to populate a combo box to allow the user to select one of the available printer and set it as the default printer. Unfortunately when the mail merge is done and the document is sent to the default printer (we are now in Word 2007) it replies that there is a problem because basically there is no default printer. Checking the printers via Start>Printers none of the printers has the tick against printer icon indicating which printer is the default printer. If I manually set the default printer (via Start>Printers) and do the mail merge again and not select a different printer then everything works fine. The code below is some code I took from the Access Help screen to test the set default option and is basically the code I use in my application - except for the fact that I supply a printer name rather than using index of the printer collection. I have executed this code changing the index number from 1 to 2 to 3 etc and it is displaying the correct printer name etc but checking the printer setting via Start>Printer after each execution the printer selected is not set as the dfault printer.
I have looked through the EE knowledge base but I can't get a resolution to my problem. Is there something wrong with my logic or is this an Access 2007 bug and if so is there a fix available.
Many Thanks in advance.
Dim prtDefault As Printer
Set Application.Printer = Application.Printers(0)
Set prtDefault = Application.Printer
MsgBox "Device name: " & .DeviceName & vbCr _
& "Driver name: " & .DriverName & vbCr _
& "Port: " & .Port