文件管理 · 2022年7月25日

delphiword字体|delphi怎么设置WORD的页边距怎么设置 WORD某一行的字体大小

1. 怎么用delphi找查word文档中的指定字符串,找到后将字符串改变颜色

这个就是调用WORD函数的问题。花了点时间给你作了一个演示。usesWord2000;procere TWMITaskManagerMainForm.ButtonWordClick(Sender: TObject);varWordApplication: TWordApplication;WordDocument: TWordDocument;DocInx, oFileName, CfCversions, oReadOnly, AddToRctFiles, PswDocument,PswTemplate, oRevert, WPswDocument, WPswTemplate, oFormat, oEncoding, oVisible: OleVariant;Idx: Integer;Row: Integer;Col: Integer;_Cell: Cell;beginWordApplication := TWordApplication.Create(nil);WordApplication.Visible := True;WordDocument := TWordDocument.Create(nil);DocInx := 1;oFileName := 'c:\test.doc';oReadOnly := True;CfCversions := EmptyParam;AddToRctFiles := EmptyParam;PswDocument := EmptyParam;PswTemplate := EmptyParam;oRevert := EmptyParam;WPswDocument := EmptyParam;WPswTemplate := EmptyParam;oFormat := EmptyParam;oEncoding := EmptyParam;oVisible := True;WordApplication.Documents.Open(oFileName, CfCversions, oReadOnly, AddToRctFiles,PswDocument, PswTemplate, oRevert, WPswDocument,WPswTemplate, oFormat, oEncoding, oVisible);WordDocument.ConnectTo(WordApplication.Documents.Item(DocInx));Idx := 1;//按列变换表格线不同颜色{for Col := 1 to WordDocument.Tables.Item(Idx).Columns.Count dobeginWordDocument.Tables.Item(Idx).Columns.Item(Col).Borders.OutsideColorIndex := Col;end; }//按行变换表格线不同颜色{for Row := 1 to WordDocument.Tables.Item(Idx).Rows.Count dobeginWordDocument.Tables.Item(Idx).Rows.Item(Row).Borders.OutsideColorIndex := Row;end }//下面是综合颜色变换 (按单元格)字体颜色、表格线颜色{for Idx := 1 to WordDocument.Tables.Count dobeginfor Row := 1 to WordDocument.Tables.Item(Idx).Rows.Count dobeginfor Col := 1 to WordDocument.Tables.Item(Idx).Columns.Count dobegin_Cell := WordDocument.Tables.Item(Idx).Cell(Row, col);_Cell.Borders.OutsideColor := clBlue;_Cell.Range.Font.Color := clRed;endend;end;}end;

2. delphi TWordApplication1的word文本加密问题(word文字字体 格式问题)

你这个问题本身就有问题,您学了编程怎么连一点逻辑都没有。举个例子:原文:很弱的问题。其中:'很'是1号字,'弱'是2号字,'的'是3号字,'问'是4号字,'题'是5号字。加密后的密文:EAD12345。我问你,原文和密文如果连长度都不一样,你想保留什么格式?'E'你想保留成几号字,你说1号我还说2号字也行呢?

3. delphi 设置word字间距

Sub Macro1()'' Macro1 Macro' 宏在 2014-08-01 由 Techwix 录制' With Selection.Font .NameFarEast = "宋体" .NameAscii = "Times New Roman" .NameOther = "Times New Roman" .Name = "" .Size = 10.5 .Bold = False .Italic = False .Underline = wdUnderlineNone .UnderlineColor = wdColorAutomatic .StrikeThrough = False .DoubleStrikeThrough = False .Outline = False .Emboss = False .Shadow = False .Hidden = False .SmallCaps = False .AllCaps = False .Color = wdColorAutomatic .Engrave = False .Superscript = False .Subscript = False .Spacing = 1.5 .Scaling = 100 .Position = 0 .Kerning = 1 .Animation = wdAnimationNone .DisableCharacterSpaceGrid = False .EmphasisMark = wdEmphasisMarkNone End WithEnd Sub录制几次宏,比较下就知道怎么用

4. delphi 将word转换成string

354行是哪行啊……另外直接用AS赋值不好么,非要COPY..完了还strtoint,这个函数是把字符串转成数字的(string转成int),你还给个word型参数,没明白你要干嘛

5. word中生僻字在delphi界面中无法展示

换新版本的Delphi (Delphi2010+)

使用Tnt控件包中的UniCode控件

6. delphi 如何将RixeEdit中的文字转化成文本文档或者word格式进行存

创建一个word的ole对象,建立一个新文件把内容写进去。

7. delphi怎么设置WORD的页边距怎么设置 WORD某一行的字体大小

分太诱人了,写一个吧……uses comobj;var word,document:olevariant;beginword:=createoleobject('word.application');document:=word.documents;document.open('c:\1.doc');word.ActiveDocument.pagesetup.topmargin:=111; //上边距topmargin 下bottommargin 左leftmargin 右 right…..word.selection.HomeKey(wdline,1); //开始选择范围word.Selection.MoveDown(wdline,3);word.selection.endkey(wdline,wdExtend );word.Selection.Font.Size:=1111; //结束范围设置,第四行文字改变。word.ActiveDocument.saveas('c:\2.doc');document.close;word.quit;word:=unassigned;end; 补充一下,需要用到控件server中的 wordapplication,通过d7测试!

8. delphi打印的时候怎样调整字体大小

分太诱人了,写一个吧……uses comobj;var word,document:olevariant;beginword:=createoleobject('word.application');document:=word.documents;document.open('c:\1.doc');word.ActiveDocument.pagesetup.topmargin:=111; //上边距topmargin 下bottommargin 左leftmargin 右 right…..word.selection.HomeKey(wdline,1); //开始选择范围word.Selection.MoveDown(wdline,3);word.selection.endkey(wdline,wdExtend );word.Selection.Font.Size:=1111; //结束范围设置,第四行文字改变。word.ActiveDocument.saveas('c:\2.doc');document.close;word.quit;word:=unassigned;end; 补充一下,需要用到控件server中的 wordapplication,通过d7测试!

9. 用Delphi实现在word文档中快速查找关键字的源代码

用OLE来实现吧! wordapp := CreateOleObject('Word.Application'); wordapp.Application.Visible := true; worddoc := wordapp.Documents.open(FileName := path + 'word.doc', ReadOnly := False, AddToRecentFiles := False); 然后用WORD录下查找的VBA代码就可以了!

10. 如何制作word字体颜色选择控件 delphi

delphi本来就有字体颜色控件,那个字体对话框可以控制字体颜色,还有专门选择颜色的控件.如果你说的是用delphi来做一个控制WORD字体颜色的控件,那得和比尔盖次沟通一下,要它把接口名称告诉你.然后按WORD上字体颜色按钮的时候,调用你的程序.