[英]How to print word document after edit it
我需要知道如何在編輯后從Windows窗體應用程序打印Word文件
我用這個鱈魚保存了我的文件
DialogResult = MessageBox.Show("This message to confirm the data", "Data Confirmation", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (DialogResult == DialogResult.OK)
{
pictureBox1.Visible = true;
string path = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
string pathTwo = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
saveFileDialog1.FileName = "MMVA" + "(" + txt_Vname.Text + ")" + CustomFormatsave() + ".docx";
saveFileDialog1.DefaultExt = ".docx";
saveFileDialog1.InitialDirectory = @"C:\";
saveFileDialog1.CheckFileExists = false;
saveFileDialog1.CheckPathExists = true;
// saveFileDialog1.ShowDialog();
DialogResult result = saveFileDialog1.ShowDialog();
if (result == DialogResult.OK)
{
CreateWordDocument(pathTwo + @"\MMVA Template .docx", saveFileDialog1.FileName);
}
保存我的文檔后,我需要打印它我可以做什么?
一種選擇是使用“打印動詞”啟動文件。 例如:
ProcessStartInfo info = new ProcessStartInfo(saveFileDialog1.FileName);
info.Verb = "Print";
info.CreateNoWindow = true;
info.WindowStyle = ProcessWindowStyle.Hidden;
Process.Start(info);
另一個選擇是使用Office SDK。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.