Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

164
Vistas
Need to have Word Document print immediately from MVC app

We have an MVC App where some users will perform an action and a side effect is that they need to have a Word Document printed at their workstation IMMEDIATELY. We don’t want a print dialog, no prompting for the number of copies, no asking for the printer, just print right away. The users are on Windows 10 Machines with Chrome or Edge as their browser and they all have Microsoft 365 installed locally. The users are not usually Administrators.

What we do have working is invoking Word from JavaScript. The JS code is usually:

window.open(link, "_blank");

Where the link looks something like (per https://docs.microsoft.com/en-us/office/client-developer/office-uri-schemes section A-3)

'ms-word:ofe|u|http://server/api/word/document/81510062.docx'

The above works to bring up Word for editing just fine, but that’s not what we want in this case. We want the system to act as if WinWord had been opened with /mFilePrintDefault and /mFileExit.

I tried adding the switches to the end of the link but didn't have any joy.

'ms-word:ofe|u|http://server/api/word/document/81510062.docx%20/mFilePrintDefault%20/mFileExit'

resulted in

This action couldn't be performed because Office doesn't recognize the command it was given.

I will say that we build the document on the fly when the action is invoked via an XML XSLT Generator, so if there is something we can bake into the Word Document, we would consider that. However, we can't have any warning dialogs about Macros, etc.

Also, ActiveX is off the table; we used that years ago with IE, but that is the distant past!

Any Ideas?

John B. on the Delmarva Peninsula

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda