Open template and set contents with Xml file with ShellHelper.OpenFile hangs

David Ribeiro 77 Reputation points
2021-03-09T17:57:10.387+00:00

Hi all,

I have inside a C# windows application a piece of code to open the word using a command like this:

ShellHelper.OpenFile("Winword.exe", "/n /f @"C:\template.dotx" /xmlFile:@"C:\data.xml")

But now & then and mostly on Windows 10 this hangs and doesn't work at all.

Am I passing some parameter wrong here? Should I be doing this in a different way?

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,306 questions
{count} votes

1 answer

Sort by: Most helpful
  1. David Ribeiro 77 Reputation points
    2021-03-10T01:14:03.507+00:00

    Found out what it was. When aplying the template, it has C# code associated that used clipboard. And I have Ditto installed, it seemed to interfere somehow.

    Turned it of and began to work like a charm.

    Thank you all.

    1 person found this answer helpful.
    0 comments No comments