In VS2019
, the following code runs CreatePDF.exe
by taking input from c:\myFolder\test.txt
, and creates a PDF
file c:\myFolder\test.pdf
. But when when I run the same code from a Microsoft WORD VSTO add-in, I don't see the output PDF
file in c:\myFolder
folder. That means the add-in is probably creating the pdf
file in some other directory. Which directory it may be creating that pdf
file in?
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.CreateNoWindow = false;
startInfo.UseShellExecute = false;
startInfo.FileName = "CreatePDF.exe";
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments = "-interaction=batchmode c:\myFolder\test.txt -output-directory=" + c:\myFolder;
startInfo.WorkingDirectory = c:\myFolder;
UPDATE
The above code is from a VSTO
project in VS2019
. When I run the project from VS2019
, it successfully creates a custom ribbon
tab along with a button inside it. When you click on that button, it successfully runs the above code and generates a pdf file c:\myFolder\test.pdf
from the text file c:\myFolder\test.txt
.
But after I run Clean Solution
to remove the custom ribbon and then I deploy the project using ClickOnce, the add-in ribbon gets deployed successfully and the other buttons inside the custom ribbon tab perform their task successfully. But the button that runs the above code does not generate the pdf file c:\myFolder\test.pdf
(unless it's creating it somewhere else).