Problem printing from Excel after printing Word doc using VB.net

H

Herbie

Hi,

I've written a Windows application in VB.net that generates and prints a
Word document using the PrintOut method after populating bookmarks in a
predefined template. After I print the document I close the document and set
the reference to nothing. Likewise I close the Word session and set its
reference to nothing. I even call the GC.Collect method.

Problem is that if I print from Excel before running the app, I get the
usual messagebox saying 'Now printing page 1 of 1 of [spreadsheet name] on
the [printername] on ne03' and the spreadsheet prints fine. After I run the
app, when I try to print from Excel I get the same messsage but ne03 is
replaced with Word. The spreadsheet appears to print but doesn't appear at
the printer. There are no additional processes running after my app closes
and the only cure is a reboot.

Any help would be much appreciated....
 
C

Cindy M.

Hi =?Utf-8?B?SGVyYmll?=,
I've written a Windows application in VB.net that generates and prints a
Word document using the PrintOut method after populating bookmarks in a
predefined template. After I print the document I close the document and set
the reference to nothing. Likewise I close the Word session and set its
reference to nothing. I even call the GC.Collect method.

Problem is that if I print from Excel before running the app, I get the
usual messagebox saying 'Now printing page 1 of 1 of [spreadsheet name] on
the [printername] on ne03' and the spreadsheet prints fine. After I run the
app, when I try to print from Excel I get the same messsage but ne03 is
replaced with Word. The spreadsheet appears to print but doesn't appear at
the printer. There are no additional processes running after my app closes
and the only cure is a reboot.
And do you change the printer when printing from Word? Changing the printer in
the Word environment will change the printer for the Windows session...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
H

Herbie

I present the user with a dropdown list of the printers set up on their local
machine. I capture their default printer at the start and reset their
default after they print (their default was being set to whatever printer
they chose.) I've coded a temporary workaround whereby I append ' on NE03'
to the printer name when resetting the default. This works but I know that
its dependent on how printers are set up on the network and its not a robust
solution.

The main problem is that I can print Word documents on any printer but that
other Office applications won't print to any printer unless I use my
temporary workaround.

Cindy M. said:
Hi =?Utf-8?B?SGVyYmll?=,
I've written a Windows application in VB.net that generates and prints a
Word document using the PrintOut method after populating bookmarks in a
predefined template. After I print the document I close the document and set
the reference to nothing. Likewise I close the Word session and set its
reference to nothing. I even call the GC.Collect method.

Problem is that if I print from Excel before running the app, I get the
usual messagebox saying 'Now printing page 1 of 1 of [spreadsheet name] on
the [printername] on ne03' and the spreadsheet prints fine. After I run the
app, when I try to print from Excel I get the same messsage but ne03 is
replaced with Word. The spreadsheet appears to print but doesn't appear at
the printer. There are no additional processes running after my app closes
and the only cure is a reboot.
And do you change the printer when printing from Word? Changing the printer in
the Word environment will change the printer for the Windows session...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)


This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
C

Cindy M.

Hi =?Utf-8?B?SGVyYmll?=,
I present the user with a dropdown list of the printers set up on their local
machine. I capture their default printer at the start and reset their
default after they print (their default was being set to whatever printer
they chose.) I've coded a temporary workaround whereby I append ' on NE03'
to the printer name when resetting the default. This works but I know that
its dependent on how printers are set up on the network and its not a robust
solution.

The main problem is that I can print Word documents on any printer but that
other Office applications won't print to any printer unless I use my
temporary workaround.
You may find that the "temporary workaround" is going to be more permanent than
you'd hoped...

pubs.logicalexpressions.com/Pub0009/LPMFrame.asp?CMD=ArticleSearch&AUTH=20

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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