我需要從SharePoint工作流打開一個Word文檔,並將其打印到特定的打印機托盤。我首先嚐試使用Word.Interop創建Word應用程序實例,但是我的doc對象始終返回null。我讀過這不是WordInterop的支持使用。所以,現在我正在尋找替代品從SharePoint工作流調用Console應用程序
我寫了一個簡單的控制檯應用程序,接受單詞文檔,打印機名稱和托盤編號作爲參數。控制檯應用程序在命令提示符下的偉大工程,但我無法調用它形成一個SharePoint工作流CodeActivity
string urlWord = GetwordDocument(printType);
System.Diagnostics.Process prcs = new System.Diagnostics.Process();
prcs.StartInfo.FileName = @"c:\DocxPrint2Tray.exe";
prcs.StartInfo.Arguments = String.Format(" \"{0}\" \"{1}\" \"{2}\" ",urlWord, printerName, printerTray);
prcs.StartInfo.UseShellExecute = false;
prcs.StartInfo.RedirectStandardOutput = true;
prcs.Start();
string prcsOut = prcs.StandardOutput.ReadToEnd();
prcs.WaitForExit();
的代碼出現在prcs.StandardOutput.ReadToEnd()線掛起。 SharePoint工作流程是否支持調用外部進程?打開任何代碼建議和替代解決方案。
在此先感謝