API Reference
Cmdlet
Add-OfficeWordField
Adds a field to the current paragraph.
Remarks
Supports standard Word field codes such as Page, Date, or NumPages.
Examples
Example 1: Add a page number field.
PS>
Add-OfficeWordParagraph { Add-OfficeWordField -Type Page }
Inserts a PAGE field into the paragraph.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.
Syntax
Add-OfficeWordField [-Advanced] [-CustomFormat <String>] [-Format <Nullable`1>] [-Paragraph <WordParagraph>] [-Parameters <String[]>] [-PassThru] -Type <AddressBlock> [<CommonParameters>]#Parameter set:
All Parameter SetsParameters
- Advanced SwitchParameter
- Use advanced field representation.
- CustomFormat String
- Custom format string (date/time fields).
- Format Nullable`1
- Optional field format switch. Possible values: Lower, Upper, FirstCap, Caps, Mergeformat, Roman, roman, Arabic, Alphabetical, ALPHABETICAL, Ordinal, OrdText, CardText, DollarText, Hex, CharFormat
- Paragraph WordParagraph
- Explicit paragraph to receive the field.
- Parameters String[]
- Additional field parameters.
- PassThru SwitchParameter
- Emit the paragraph after adding the field.
- Type WordFieldType
- Field type to insert. Possible values: AddressBlock, Advance, Ask, Author, AutoNum, AutoNumLgl, AutoNumOut, AutoText, AutoTextList, Bibliography, Citation, Comments, Compare, CreateDate, Database, Date, DocProperty, DocVariable, Embed, FileName, FileSize, GoToButton, GreetingLine, HyperlinkIf, IncludePicture, IncludeText, Index, Info, Keywords, LastSavedBy, Link, ListNum, MacroButton, MergeField, MergeRec, MergeSeq, Next, NextIf, NoteRef, NumChars, NumPages, NumWords, Page, PageRef, Print, PrintDate, Private, Quote, RD, Ref, RevNum, SaveDate, Section, SectionPages, Seq, Set, SkipIf, StyleRef, Subject, Symbol, TA, TC, Template, Time, Title, TOA, TOC, UserAddress, UserInitials, UserName, XE, Formula, EQ
- Possible values:
AddressBlock,Advance,Ask,Author,AutoNum,AutoNumLgl,AutoNumOut,AutoText,AutoTextList,Bibliography,Citation,Comments,Compare,CreateDate,Database,Date,DocProperty,DocVariable,Embed,FileName,FileSize,GoToButton,GreetingLine,HyperlinkIf,IncludePicture,IncludeText,Index,Info,Keywords,LastSavedBy,Link,ListNum,MacroButton,MergeField,MergeRec,MergeSeq,Next,NextIf,NoteRef,NumChars,NumPages,NumWords,Page,PageRef,Print,PrintDate,Private,Quote,RD,Ref,RevNum,SaveDate,Section,SectionPages,Seq,Set,SkipIf,StyleRef,Subject,Symbol,TA,TC,Template,Time,Title,TOA,TOC,UserAddress,UserInitials,UserName,XE,Formula,EQ