1
using System;
2
using System.Collections.Generic;
3
using System.Text;
4
using Word;
5
using System.Reflection;
6
using System.Runtime.InteropServices;
7
using System.Data;
8
using System.Configuration;
9
using System.IO;
10
11
namespace CNINSURE.WEB.COMMON
12
{
13
public class EnDoc
14
{
15
//public static void MessageBox(int h, string m, string c, int type)
16
//{ }
17
Word.ApplicationClass app = new Word.ApplicationClass();
18
object optional = Missing.Value;
19
object visible = true;
20
object saveChanges = true;
21
object NOTsaveChanges = false;
22
object docreadonly = true;
23
object originalFormat = Missing.Value;
24
object routeDocument = Missing.Value;
25
_Document doc = null;
26
// FillCtl f=new FillCtl ();
27
28
private string dotpath;
29
public string DotPath
30
{
31
get
32
{
33
return dotpath;
34
}
35
set
36
{
37
dotpath = value;
38
}
39
}
40
private string GetData(string str)
41
{
42
if (str == null)
43
str = "";
44
else
45
str = str.Trim();
46
return str;
47
}
48
49
******打开文件*******
70
71
******写入数据*******
107
108
******向表格写入数据*******
150
151
*******将图片写入WORd中********
166
167
******创建表格*******
216
217
******删除表格*******
233
234
******文件另存为*******
248
249
******关闭word*******
274
275
private object[] GetMark()
276
{
277
object j = null;
278
string str = "";
279
object[] result = new object[doc.Bookmarks.Count];
280
for (int i = 1; i <= doc.Bookmarks.Count; i++)
281
{
282
j = (object)i;
283
result[i - 1] = doc.Bookmarks.get_Item(ref j).Name;
284
str = str + doc.Bookmarks.get_Item(ref j).Name + ",";
285
}
286
return result;
287
}
288
}
289
}
290
using System;2
using System.Collections.Generic;3
using System.Text;4
using Word;5
using System.Reflection;6
using System.Runtime.InteropServices;7
using System.Data;8
using System.Configuration;9
using System.IO;10

11
namespace CNINSURE.WEB.COMMON12
{13
public class EnDoc14
{15
//public static void MessageBox(int h, string m, string c, int type)16
//{ }17
Word.ApplicationClass app = new Word.ApplicationClass();18
object optional = Missing.Value;19
object visible = true;20
object saveChanges = true;21
object NOTsaveChanges = false;22
object docreadonly = true;23
object originalFormat = Missing.Value;24
object routeDocument = Missing.Value;25
_Document doc = null;26
// FillCtl f=new FillCtl ();27

28
private string dotpath;29
public string DotPath30
{31
get32
{33
return dotpath;34
}35
set36
{37
dotpath = value;38
}39
}40
private string GetData(string str)41
{42
if (str == null)43
str = "";44
else45
str = str.Trim();46
return str;47
}48

49
******打开文件*******70

71
******写入数据*******107

108
******向表格写入数据*******150

151
*******将图片写入WORd中********166

167
******创建表格*******216

217
******删除表格*******233

234
******文件另存为*******248

249
******关闭word*******274

275
private object[] GetMark()276
{277
object j = null;278
string str = "";279
object[] result = new object[doc.Bookmarks.Count];280
for (int i = 1; i <= doc.Bookmarks.Count; i++)281
{282
j = (object)i;283
result[i - 1] = doc.Bookmarks.get_Item(ref j).Name;284
str = str + doc.Bookmarks.get_Item(ref j).Name + ",";285
}286
return result;287
}288
}289
}290



浙公网安备 33010602011771号