[英]How to print word document after edit it
i need to know how to print word file from windows form application after edit it 我需要知道如何在编辑后从Windows窗体应用程序打印Word文件
i used this cod to save my document 我用这个鳕鱼保存了我的文件
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);
}
after save my document i need to print it what i can do ?? 保存我的文档后,我需要打印它我可以做什么?
One option is to launch the file with the Print Verb. 一种选择是使用“打印动词”启动文件。 For example:
例如:
ProcessStartInfo info = new ProcessStartInfo(saveFileDialog1.FileName);
info.Verb = "Print";
info.CreateNoWindow = true;
info.WindowStyle = ProcessWindowStyle.Hidden;
Process.Start(info);
The other option is to use the Office SDK. 另一个选择是使用Office SDK。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.