Diese Dokumentation wurde archiviert und wird nicht länger gepflegt.

Fields.Add Method

Adds a Field object to the Fields collection.

Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in microsoft.office.interop.word.dll)

Dim Range As Range
Dim Type As Object
Dim Text As Object
Dim PreserveFormatting As Object
Dim returnValue As Field
Dim fields1 As Fields
returnValue = fields1.Add(Range, Type, Text, PreserveFormatting)

Field Add(
	[In] Range Range, 
	[In, Optional] ref object Type, 
	[In, Optional] ref object Text, 
	[In, Optional] ref object PreserveFormatting
public Field Add(
	/*in*/Range Range, 
	/*in*/System.Object Type, 
	/*in*/System.Object Text, 
	/*in*/System.Object PreserveFormatting
function Add(
	 Range : Range, 
	 Type : Object, 
	 Text : Object, 
	 PreserveFormatting : Object
) : Field;



Required Range object. The range where you want to add the field. If the range isn't collapsed, the field replaces the range.


Optional Object. Can be any WdFieldType constant. For a list of valid constants, consult the Object Browser. The default value is wdFieldEmpty.


Optional Object. Additional text needed for the field. For example, if you want to specify a switch for the field, you would add it here.


Optional Object. True to have the formatting that's applied to the field preserved during updates.

This method returns the Field object at the specified range.

You cannot insert some fields (such as wdFieldOCX and wdFieldFormCheckBox) by using the Add method of the Fields collection. Instead, you must use specific methods such as the AddOLEControl method and the Add method for the FormFields collection.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms