Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

167
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda