Word VBA教程:Visual Basic 命令对照表 F

ABCDEFGHIJKLMNOPRSTUVWY

F  
FieldSeparator$ Application.DefaultTableSeparator
FileAOCEAddMailer ActiveDocument.HasMailer = True
FileAOCEDeleteMailer ActiveDocument.HasMailer = False
FileAOCEExpandMailer 仅用于 Macintosh 系统
FileAOCEForwardMail ActiveDocument.ForwardMailer
FileAOCENextLetter Application.NextLetter
FileAOCEReplyAllMail 仅用于 Macintosh 系统
FileAOCEReplyMail 仅用于 Macintosh 系统
FileAOCESendMail ActiveDocument.SendMailer
FileClose ActiveDocument.Close
FileCloseAll Documents.Close
FileClosePicture ActiveDocument.Close
FileConfirmConversions Options.ConfirmConversions = True
FileCreator$() 仅用于 Macintosh 系统
FileDocumentLayout 仅用于 Macintosh 系统
FileExit Application.Quit
FileFind Application.FileSearch
FileList number RecentFiles(num).Open
FileMacCustomPageSetupGX 仅用于 Macintosh 系统
FileMacPageSetup 仅用于 Macintosh 系统
FileMacPageSetupGX 仅用于 Macintosh 系统
FileName$()

FileName$(num)

x = ActiveDocument.FullName

x = RecentFiles(num).Name & Application.PathSeparator & RecentFiles(num).Path

FileNameFromWindow$() x = Windows(1).Document.FullName
FileNameInfo$() x =WordBasic.[FileNameInfo$]()

x = ActiveDocument.Name

x = ActiveDocument.Path

x = ActiveDocument.FullName

FileNew Template Documents.Add Template:=filename
FileNewDefault Documents.Add
File num RecentFiles(num).Open
FileOpen Documents.Open
FilePost ActiveDocument.Post
FilePageSetup Tab, TopMargin, BottomMargin, LeftMargin, RightMargin, Gutter, PageWidth, PageHeight, Orientation, FirstPage, OtherPages, VertAlign, ApplyPropsTo, Default, FacingPages, HeaderDistance, FooterDistance, SectionStart, OddAndEvenPages, DifferentFirstPage, Endnotes, LineNum, StartingNum, FromText, CountBy, NumMode With ActiveDocument.PageSetup

    .TopMargin = num

    .BottomMargin = num

    .LeftMargin = num

    .RightMargin = num

    .Gutter = num

    .PageHeight = num

    .PageWidth = num

    .Orientation = WdOrientation

    .FirstPageTray = WdPaperTray

    .OtherPagesTray = WdPaperTray

    .VerticalAlignment = WdVerticalAlignment

    .SetAsTemplateDefault

    .MirrorMargins = True

    .HeaderDistance = num

    .FooterDistance = num

    .SectionStart = WdSectionStart

    .OddAndEvenPagesHeaderFooter = True

    .DifferentFirstPageHeaderFooter = True

    .SuppressEndnotes = True

    With LineNumbering

        .Active =True

        .StartingNumber = num

        .DistanceFromText = num

        .CountBy = num

        .RestartMode = WdNumberingRule

    End With

End With

FilePreview 图像控件
FilePrint ActiveDocument.PrintOut
FilePrintDefault ActiveDocument.PrintOut
FilePrintOneCopy 仅用于 Macintosh 系统
FilePrintPreview, FilePrintPreview() PrintPreview = True

x =PrintPreview

FilePrintPreviewFullScreen PrintPreview = True

ActiveWindow.View.FullScreen = True

FilePrintPreviewPages, FilePrintPreviewPages() With ActiveWindow.View.Zoom

    .PageColumns = 2

    .PageRows = 1

End With

FilePrintSetup ActivePrinter
FileProperties WordBasic.FileProperties
FileQuit Application.Quit
FileRoutingSlip Subject, Message, AllAtOnce, ReturnWhenDone, TrackStatus, Protect

FileRoutingSlip AddSlip

FileRoutingSlip RouteDocument

FileRoutingSlip AddRecipient

FileRoutingSlip ResetSlip

FileRoutingSlip ClearSlip

With ActiveDocument.RoutingSlip

    .Subject = text

    .Message = text

    .Delivery = WdRoutingSlipDelivery

    .ReturnWhenDone = True

    .TrackStatus = True

    .Protect = WdProtectionType

End With

ActiveDocument.HasRoutingSlip = True

ActiveDocument.Route

ActiveDocument.RoutingSlip.AddRecipient

ActiveDocument.RoutingSlip.Reset

ActiveDocument.HasRoutingSlip = False

Files$() Dir()
FileSave ActiveDocument.Save
FileSaveAll Documents.Save
FileSaveAs ActiveDocument.SaveAs
FileSendMail ActiveDocument.SendMail
FileSummaryInfo Title, Subject, Author, Keywords, Comments, FileName, Directory, Template, CreateDate, LastSavedDate, LastSavedBy, RevisionNumber, EditTime, LastPrintedDate, NumPages, NumWords, NumChars, NumParas, NumLines, FileSize With ActiveDocument

    .BuiltInDocumentProperties(wdPropertyTitle)

    .BuiltInDocumentProperties(wdPropertySubject)

    .BuiltInDocumentProperties(wdPropertyLastAuthor)

    .BuiltInDocumentProperties(wdPropertyKeywords)

    .BuiltInDocumentProperties(wdPropertyComments)

    .Name

    .Path

    .BuiltInDocumentProperties(wdPropertyTemplate)

    .BuiltInDocumentProperties(wdPropertyTimeCreated)

    .BuiltInDocumentProperties(wdPropertyTimeLastSaved)

    .BuiltInDocumentProperties(wdPropertyLastAuthor)

    .BuiltInDocumentProperties(wdPropertyRevision)

    .BuiltInDocumentProperties(wdPropertyVBATotalEdit)

    .BuiltInDocumentProperties(wdPropertyTimeLastPrinted)

    .BuiltInDocumentProperties(wdPropertyPages)

    .BuiltInDocumentProperties(wdPropertyWords)

    .BuiltInDocumentProperties(wdPropertyCharacters)

    .BuiltInDocumentProperties(wdPropertyParas)

    .BuiltInDocumentProperties(wdPropertyLines)

    .BuiltInDocumentProperties(wdPropertyBytes)

End With

FileTemplates ActiveDocument.AttachedTemplate = template
FileType$() 仅用于 Macintosh 系统
Font, Font$() Selection.Font.Name = text

x = Selection.Font.Name

FontSize, FontSize() Selection.Font.Size = num

x = Selection.Font.Size

FontSizeSelect Application.Run MacroName:="FontSizeSelect"
FontSubstitution Application.SubstituteFont
For...Next For...Next
FormatAddrFonts '设置 Font对象的属性

With ActiveDocument.Envelope.Address.Font

    .Size = num

    .ColorIndex = WdColorIndex

    .Bold = True

End With

FormatAutoFormat ActiveDocument.AutoFormat
FormatBordersAndShading Shadow, TopBorder, LeftBorder, BottomBorder, RightBorder, HorizBorder, VertBorder, TopColor, LeftColor, BottomColor, RightColor, HorizColor, VertColor, FineShading, FromText, Shading, Foreground, Background, Tab With ActiveDocument.Paragraphs(1).Borders

    .Shadow = True

    .DistanceFromBottom = num

    .DistanceFromTop = num

    .DistanceFromLeft = num

    .DistanceFromRight = num

End With

With Selection.Shading

    .Texture = WdTextureIndex

    .BackgroundPatternColorIndex = WdColorIndex

    .ForegroundPatternColorIndex = WdColorIndex

End With

With ActiveDocument.Paragraphs(1)

    .Borders(WdBorderType).LineStyle = WdLineStyle

    .Borders(WdBorderType).LineWidth = WdLineWidth

    .Borders(WdBorderType).ColorIndex = WdColorIndex

End With

With Dialogs(wdDialogFormatBordersAndShading)

    .DefaultTab = WdWordDialogTab

    .Show

End With

FormatBullet Points, Color, Alignment, Indent, Space, Hang, CharNum, Font With ListGalleries(wdBulletGallery).ListTemplates(1).ListLevels(1)

    .NumberFormat = ChrW(num)

    .NumberStyle = wdListNumberStyleBullet

    .NumberPosition = num

    .Alignment = WdListLevelAlignment

    .TextPosition = num

    .TabPosition = num

    With .Font

        .Size = num

        .Name = text

        .ColorIndex = WdColorIndex

    End With

End With

FormatBulletDefault, FormatBulletDefault() Selection.Range.ListFormat.ApplyBulletDefault

Selection.Range.ListFormat.RemoveNumbers

FormatBulletsAndNumbering Remove, Hang, Preset Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=ListGalleries(WdListGalleryType).ListTemplates(num)

Selection.Range.ListFormat.RemoveNumbers

FormatCallout Type, Gap, Angle, Drop, Length, Border, AutoAttach, Accent With ActiveDocument.Shapes(1).Callout

    .Type = MsoCalloutType

    .Gap = num

    .Angle = MsoCalloutAngleType

    .Drop = num

    .DropType = MsoCalloutDropType

    .Length = num

    .Border = MsoTriState

    .AutoAttach = MsoTriState

    .Accent = MsoTriState

End With

FormatChangeCase Selection.Range.Case = WdCharacterCase
FormatColumns Columns, ColumnWidth, ColumnSpacing, EvenlySpaced, ColLine With ActiveDocument.TextColumns

    .SetCount NumColumns:=num

    .Width = num

    .Spacing = num

    .EvenlySpaced = False

    .LineBetween = False

End With

FormatDefineStyleBorders '设置Borders对象的属性

With ActiveDocument.Styles(name).Borders

    .Enable = True

    .Shadow = True

End With

FormatDefineStyleFont '设置Font对象的属性

With ActiveDocument.Styles(name).Font

    .Bold = True

    .Name = "Arial"

End With

FormatDefineStyleFrame '设置Frame对象的属性

With ActiveDocument.Styles(name).Frame

    .Width = num

    .VerticalPosition = num

End With

FormatDefineStyleLang ActiveDocument.Styles(name).LanguageID = WdLanguageID
FormatDefineStyleNumbers '设置ListLevel对象的属性

With ActiveDocument.Styles(name). ListGalleries(WdListGalleryType).ListTemplates(num).ListLevels(num)

    .NumberFormat = "%1)"

    .TrailingCharacter = wdTrailingTab

    .NumberStyle = wdListNumberStyleArabic

End With

FormatDefineStylePara '设置ParagraphFormat对象的属性

With ActiveDocument.Styles(name).ParagraphFormat

    .SpaceAfter = num

    .RightIndent = num

End With

FormatDefineStyleTabs '设置TabStops对象的属性

ActiveDocument.Styles(name).ParagraphFormat.TabStops(1).Leader = WdTabLeader

FormatDrawingObject Set properties of theShape object.
FormatDropCap Position, Font, DropHeight, DistFromText With ActiveDocument.Paragraphs(1).DropCap

    .Position = WdDropPosition

    .FontName = text

    .LinesToDrop = num

    .DistanceFromText = num

End With

FormatFont Points, Underline, Color, Strikethrough, Superscript, Subscript, Shadow, Hidden, SmallCaps, AllCaps, Outline, Spacing, Position, Kerning, KerningMin, Default, Tab, Font, Bold, Italic With Selection.Font

    .Size = num

    .Underline = True

    .ColorIndex = WdColorIndex

    .StrikeThrough = True

    .Superscript = num

    .Subscript = num

    .Shadow = True

    .Hidden = True

    .SmallCaps = True

    .AllCaps = True

    .Outline = True

    .Spacing = num

    .Position = num

    .Kerning = num

    .SetAsTemplateDefault

    .Font = name

    .Bold = True

    .Italic = True

End With

With Dialogs(wdDialogFormatFont)

    .DefaultTab = WdWordDialogTab

    .Show

End With

FormatFrame Wrap, WidthRule, FixedWidth, HeightRule, FixedHeight, PositionHorz, PositionHorzRel, DistFromText, PositionVert, PositionVertRel, DistVertFromText, MoveWithText, LockAnchor, RemoveFrame With ActiveDocument.Frames(1)

    .TextWrap = True

    .WidthRule = WdFrameSizeRule

    .Width = num

   .Height = num  

    .HeightRule = WdFrameSizeRule

    .HorizontalPosition = num

    .RelativeHorizontalPosition = WdRelativeHorizontalPosition

    .HorizontalDistanceFromText = num

    .VerticalPosition = num

    .RelativeVerticalPosition = WdRelativeVerticalPosition

    .VerticalDistanceFromText = num

    .LockAnchor = True

    .Delete

End With

FormatHeaderFooterLink ActiveDocument.Sections(num).Headers(WdHeaderFooterIndex).LinkToPrevious = True

'或

ActiveDocument.Sections(num).Footers(WdHeaderFooterIndex).LinkToPrevious = True

FormatHeadingNumber With ListGalleries(WdListGalleryType).ListTemplates(num).ListLevels(num)

   '设置 ListLevel对象的属性并使用ApplyListTemplate方法

End With

FormatHeadingNumbering '设置 ListLevel对象的属性并使用 ApplyListTemplate方法

Set atemp = ListGalleries(wdOutlineNumberGallery).ListTemplates(num)

With atemp.ListLevels(1)

    .NumberFormat = "Chapter %1"

    .TrailingCharacter = wdTrailingNone

    .NumberStyle = wdListNumberStyleArabic

End With

Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=atemp

FormatMultilevel '设置 ListLevel对象的属性并使用 ApplyListTemplate方法

Set atemp = ListGalleries(wdOutlineNumberGallery).ListTemplates(num)

atemp.ListLevels(1).NumberStyle = wdListNumberStyleLowercaseLetter

Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=atemp

FormatNumber '设置 ListLevel对象的属性并使用 ApplyListTemplate方法

Set atemp = ListGalleries(wdNumberGallery).ListTemplates(num)

With atemp.ListLevels(1)

    .NumberFormat = "%1."

    .TrailingCharacter = wdTrailingTab

    .NumberStyle = wdListNumberStyleArabic

End With

Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=atemp

FormatNumberDefault, FormatNumberDefault() Selection.Range.ListFormat.ApplyNumberDefault

Selection.Range.ListFormat.RemoveNumbers

FormatPageNumber ChapterNumber, NumRestart, NumFormat, StartingNum, Level, Separator With Section.Footers(wdHeaderFooterPrimary).PageNumbers

    .IncludeChapterNumber = True

    .RestartNumberingAtSection = True

    .NumberStyle = WdPageNumberStyle

    .StartingNumber = num

    .HeadingLevelForChapter = num

    .ChapterPageSeparator = WdSeparatorType

End With

FormatParagraph LeftIndent, RightIndent, Before, After, LineSpacingRule, LineSpacing, Alignment, WidowControl, KeepWithNext, KeepTogether, PageBreak, NoLineNum, DontHyphen, Tab, FirstIndent With ActiveDocument.Paragraphs(1)

    .LeftIndent = num

    .RightIndent = num

    .SpaceBefore = num

    .SpaceAfter = num

    .LineSpacingRule = WdLineSpacing

    .LineSpacing = num

    .Alignment = WdParagraphAlignment

    .WidowControl = True

    .KeepWithNext = True

    .KeepTogether = True

    .PageBreakBefore = True

    .NoLineNumber = True

    .Hyphenation = True

    .FirstLineIndent = num

End With

With Dialogs(wdDialogFormatParagraph)

    .DefaultTab = WdWordDialogTab

    .Show

End With

FormatPicture SetSize, CropLeft, CropRight, CropTop, CropBottom, ScaleX, ScaleY, SizeX, SizeY With ActiveDoucment.InlineShapes(1)

    .Width = num

    .Height = num

    .ScaleHeight = num

    .ScaleWidth = num

    With .PictureFormat

        .CropBottom = num

        .CropLeft = num

        .CropRight = num

        .CropTop = num

    End With

End With

FormatRetAddrFonts '设置 Font对象的属性

With ActiveDocument.Envelope.ReturnAddress.Font

    .Size = num

    .ColorIndex = WdColorIndex

    .Bold = True

End With

FormatSectionLayout SectionStart, VertAlign, Endnotes, LineNum, StartingNum, FromText, CountBy, NumMode With ActiveDocument.PageSetup

    .VerticalAlignment = WdVerticalAlignment

    .SectionStart = WdSectionStart

    .SuppressEndnotes = True

    With LineNumbering

        .Active =True

        .StartingNumber = num

        .DistanceFromText = num

        .CountBy = num

        .RestartMode = WdNumberingRule

    End With

End With

FormatStyle Name, Delete, Merge, NewName, BasedOn, NextStyle, Type, FileName, Source, AddToTemplate, Define, Rename, Apply With ActiveDocument.Styles(name)

    .Delete

    .NameLocal = name

    .BaseStyle = text

    .NextParagraphStyle = style

    x = .Type

End With

Application.OrganizerCopy

With ActiveDocument

    .UpdateStyles

    .CopyStylesFromTemplate

End With

ActiveDocument.Styles.Add

Selection.Style = name

FormatStyleGallery ActiveDocument.CopyStylesFromTemplate
FormatTabs Position, DefTabs, Align, Leader, Set, Clear, ClearAll With Selection.Paragraphs.TabStops

    .ClearAll

    .Add Position:=num, Alignment:= WdTabAlignment, Leader:= WdTabLeader

    .Item(1).Clear

End With

ActiveDocument.DefaultTabStop

FormFieldOptions Entry, Exit, Name, Enable, TextType, TextWidth, TextDefault, TextFormat, CheckSize, CheckWidth, CheckDefault, Type, OwnHelp, HelpText, OwnStat, StatText With ActiveDocument.FormFields(1)

    .EntryMacro = text

    .ExitMacro = text

    .Name = text

    .Enabled = True

    .OwnHelp = True

    .HelpText = text

    .OwnStatus = True

    .StatusText = text

    .Type = WdFieldType

End With

With ActiveDocument.FormFields(1).TextInput

    .Width = num

    .Default = text

    .EditType

End With

With ActiveDocument.FormFields(1).CheckBox

    .Size = num

    .AutoSize = True

    .Default = True

End With

FormShading ActiveDocument.FormFields.Shaded = True
FoundFileName$() Application.FileSearch.FoundFiles(num)
Function...End Function Function…End Function

Word VBA教程

Word VBA参考教程:目录1 Word VBA参考教程:目录2
Word VBA参考教程:目录3 Word VBA参考教程:目录4
Word VBA参考教程:目录5 Word VBA参考教程:目录6
Word VBA参考教程:目录7 Word VBA参考教程:目录8
Word VBA参考教程:目录9 Word VBA参考教程:目录10
版权所有 © 中山市飞娥软件工作室 证书:粤ICP备09170368号