=?Utf-8?B?RGVyZWs=?= <> wrote in
news:B34A62D9-6F24-4FF3-BBDF-:
> When the code runs I am asked "Do you want to save or open this file?".
>
> I click open and a macro runs in the word document and word closes down.
>
> How can I by pass the dialog box and just print the document?
AFAIK, you can't do this in ASP.NET. The reason is simple: the code is on
hte server side and the application is opening on the client side. As a
Word doc can contain evil macros (while your print macro does not qualify
as evil, some people are not as nice), the user should always be prompted
so he can abort opening the document if it does not come from a trusted
source. This does not help you, of course.
The only option I can think of that might avoid this is setting up Word as
a MIME type, but even then I think you would need some corporate trust
policy to avoid save/open and force the open.
I could be partially incorrect on this, as I have not heavily invested in
Office/web automation, but the concept that the browser tries to save a
user from himself is sound.
If you want to retool so the file is printed from the server side, you have
some options, esp. with third party office libs. This can work in a
corporate environment, but would not work on a public website.
Peace and Grace,
--
Gregory A. Beamer (MVP)
Twitter: @gbworld
Blog:
http://gregorybeamer.spaces.live.com
*******************************************
| Think outside the box! |
*******************************************