繁体   English   中英

编辑后如何打印Word文档

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM