控制WORD大讨论,文章、原码(希望添加注释,解释常量、函数)均可!(300分)

  • 主题发起人 主题发起人 fbyang
  • 开始时间 开始时间
F

fbyang

Unregistered / Unconfirmed
GUEST, unregistred user!
我在大富翁看到的关于控制WORD的帖子都解释的不是很全面,而我又面一点,希望大家贴一些好的文章、自写的程序(加上注释),以便全面了解“控制WORD”的方法。
我目前有一些疑惑,先列出来
1、一些参数不明白wdCharacter、wdScreen、wdExtend等,具体解释什么地方有?
2、Range如何控制,如果我想修改表格的边框等,怎么做?
3、什么地方有控制word的介绍比较全面的书籍?
 
http://www.delphibbs.com/delphibbs/dispq.asp?lid=737517
Delphi与Word之间的融合技术
来自:yzhshi, 时间:2001-11-18 17:52:00, ID:737517
 
可以WORD中使用宏进行调用!
 
这是我收集的部分资料.

MSWord := CreateOLEObject('Word.Application');//连接Word
MSWord.Documents.Open(FileName:='d:/test.doc', ReadOnly:=True);//打开外部Word文档
MSWord.Visible := 0;//是否显示文件编辑
MSWord.ActiveDocument.Range(Start:=0, End:=0);//开始改变的启止位置
MSWord.ActiveDocument.Range.InsertAfter(Text:='Title');//在Word中增加字符'Title'
MSWord.ActiveDocument.Range.InsertParagraphAfter;
MSWord.ActiveDocument.Range.Font.Name := 'Arial';//字体名称
MSWord.ActiveDocument.Range.Font.Size := 24;//字体大小

word 常量对照表

unit cnsword;

interface

const
{WdColorIndex}
wdAuto = 0;
wdBlack = 1;
wdBlue = 2;
wdTurquoise = 3;
wdBrightGreen = 4;
wdPink = 5;
wdRed = 6;
wdYellow = 7;
wdWhite = 8;
wdDarkBlue = 9;
wdTeal = 10;
wdGreen = 11;
wdViolet = 12;
wdDarkRed = 13;
wdDarkYellow = 14;
wdGray50 = 15;
wdGray25 = 16;
wdByAuthor = -1;
wdNoHighlight = 0;
{WdOrientation}
wdOrientPortrait = 0;
wdOrientLandscape = 1;
{WdPaperSize}
wdPaper10x14 = 0;
wdPaper11x17 = 1;
wdPaperLetter = 2;
wdPaperLetterSmall = 3;
wdPaperLegal = 4;
wdPaperExecutive = 5;
wdPaperA3 = 6;
wdPaperA4 = 7;
wdPaperA4Small = 8;
wdPaperA5 = 9;
wdPaperB4 = 10;
wdPaperB5 = 11;
wdPaperCSheet = 12;
wdPaperDSheet = 13;
wdPaperESheet = 14;
wdPaperFanfoldLegalGerman = 15;
wdPaperFanfoldStdGerman = 16;
wdPaperFanfoldUS = 17;
wdPaperFolio = 18;
wdPaperLedger = 19;
wdPaperNote = 20;
wdPaperQuarto = 21;
wdPaperStatement = 22;
wdPaperTabloid = 23;
wdPaperEnvelope9 = 24;
wdPaperEnvelope10 = 25;
wdPaperEnvelope11 = 26;
wdPaperEnvelope12 = 27;
wdPaperEnvelope14 = 28;
wdPaperEnvelopeB4 = 29;
wdPaperEnvelopeB5 = 30;
wdPaperEnvelopeB6 = 31;
wdPaperEnvelopeC3 = 32;
wdPaperEnvelopeC4 = 33;
wdPaperEnvelopeC5 = 34;
wdPaperEnvelopeC6 = 35;
wdPaperEnvelopeC65 = 36;
wdPaperEnvelopeDL = 37;
wdPaperEnvelopeItaly = 38;
wdPaperEnvelopeMonarch = 39;
wdPaperEnvelopePersonal = 40;
wdPaperCustom = 41;
implementation

end.

 
最全的就是MSDN
 
到http://www.ntko.com去看看,解决教彻底!
 
后退
顶部