Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Returns a copy of a Font object that represents the character formatting of the specified font.
Syntax
expression.Duplicate
expression Required. A variable that represents a Font object.
Remarks
Use the Duplicate property to pick up the settings of all the properties of a duplicated Font object. You can assign the object returned by the Duplicate property to another Font object to apply those settings all at once. Before assigning the duplicate object to another object, you can change any of the properties of the duplicate object without affecting the original.
Example
This example sets the variable MyDupFont to the character formatting of the selection, removes bold formatting from MyDupFont, and adds italic formatting to it instead. The example also creates a new document, inserts text into it, and then applies the formatting stored in MyDupFont to the text.
Set myDupFont = Selection.Font.Duplicate
With myDupFont
.Bold = False
.Italic = True
End With
Documents.Add
Selection.InsertAfter "This is some text."
Selection.Font = myDupFont
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.