forked from nero19960329/WordAddIn
/
CopiesForm.cs
54 lines (49 loc) · 1.56 KB
/
CopiesForm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CCWin;
using System.IO;
using System.Threading;
using Word = Microsoft.Office.Interop.Word;
namespace WordAddIn
{
public partial class CopiesForm : CCSkinMain
{
ThisAddIn myThisAddIn;
Word.Application WordApp;
object FileName;
int copies;
public CopiesForm(ThisAddIn thisAddIn, Word.Application wordApp, object fileName)
{
InitializeComponent();
myThisAddIn = thisAddIn;
WordApp = wordApp;
FileName = fileName;
copies = 0;
}
private void skinButton1_Click(object sender, EventArgs e)
{
copies = (int)skinNumericUpDown1.Value;
Print();
Close();
}
private void Print()
{
object oMissing = System.Reflection.Missing.Value;
myThisAddIn.FreePrintFlag = 0;
WordApp.ActiveDocument.PrintOut(ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing,
ref oMissing, copies, ref oMissing,
ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing); //打印
myThisAddIn.FreePrintFlag = 1;
}
}
}