(112) ActiveSheet.Columns("B").Insert ‘在A列右侧插入列,即插入B列ActiveSheet.Columns("E").Cut ActiveSheet.Columns("B").Insert ‘以上两句将E列数据移至B列,原B列及以后的数据相应后移ActiveSheet.Columns("B").Cut ActiveSheet.Columns("E").Insert ‘以上两句将B列数据移至D列,原C列和D列数据相...
SubInsertFormatText()DimrngFormatAsRangeSetrngFormat = ActiveDocument.Range(Start:=0,End:=0)WithrngFormat.InsertAfterText:="Title".InsertParagraphAfterWith.Font.Name ="Tahoma".Size =24.Bold =TrueEndWithEndWithWithActiveDocument.Paragraphs(1).Alignment = wdAlignParagraphCenter.SpaceAfter = InchesToPoints...
InsertTextInRange = True End With End Function 请注意,在范围中插入文本之前,使用了 IsLastCharParagraph 过程来删除最后一个段落的段落标记。以下示例使用 Chr$() 函数,以字符代码 13 表示段落标记。 Function IsLastCharParagraph(ByRef rngTextRange As Word.Range, _ Optional blnTrimParaMark As Boolean = ...
PublicEnumopgTextInsertModeBeforeAfterReplaceEndEnum FunctionInsertTextInRange(strNewTextAs String, _OptionalrngRangeAsWord.Range, _OptionalintInsertModeAsopgTextInsertMode= _Replace) As Boolean'此过程将strNewText参数指定文本插入'rngRange指定的Range对象中。它调用'IsLastCharParagraph过程从rngRange'对象清除...
ThisDocument.Range.InsertAfter('String') 'Insert text Selection.WholeStory 'Select whole document Selection.Expand wdParagraph 'Expands your selection to current paragraph Selection.Copy 'Copy your selection Documents('name.doc').Activate 'Activate the other document Selection.EndKey wdStory 'Move to ...
31、l intInsertMode As opgTextInsertMode = _ Replace) As Boolean ' 此过程将 strNewText 参数指定文本插入 ' rngRange 指定的 Range 对象中。它调用 ' IsLastCharParagraph 过程从 rngRange ' 对象清除后续的段落 32、标记。 Call IsLastCharParagraph(rngRange, True)With rngRange Select Case intInsert...
.ParagraphFormat.Alignment = wdAlignParagraphJustify End With End Sub 插入文字并应用字符和段落格式 下列示例在当前文档的上部添加单词 Title。第一段居中对齐,并在该段落之后添加半英寸的间距。将单词 Title 的格式设为 24 磅 Arial 字体。 Sub InsertFormatText() Dim rngFormat As Range Set rngFormat = Act...
Paragraphs/Paragraph对象 - - - - - - - - - - - - - - - - - - - - - - (353) Selection.Paragraphs.Count '返回所选区域的段落数 (354) Selection.Paragraphs.First '返回所选区域中的第一段 (355) ActiveDocument.Paragraphs(1).LeftIndent '返回当前文档中第一段的左缩进值 ...
Insert File: Selection.InsertFile ("C:\Docs\Something.doc") Insert Page Break: Selection.InsertBreak Type:=wdPageBreak Insert Paragraph Symbol: Selection.TypeText Text:=Chr$(182) Insert Section Symbol: Selection.TypeText Text:=Chr$(167)
Paragraphs/Paragraph对象 - - - - - - - - - - - - - - - - - - - - - - (353) Selection.Paragraphs.Count '返回所选区域的段落数 (354) Selection.Paragraphs.First '返回所选区域中的第一段 (355) ActiveDocument.Paragraphs(1).LeftIndent '返回当前文档中第一段的左缩进值 (356) ActiveDocum...