NewFile.Remove method (Office)

Removes an item from the New Item task pane. Returns a Boolean value to indicate whether the operation was successful.

Syntax

expression.Remove (FileName, Section, DisplayName, Action)

expression Required. A variable that represents a NewFile object.

Parameters

Name Required/Optional Data type Description
FileName Required String The name of the file reference.
Section Optional Variant The section of the task pane where the file reference exists. Can be any msoFileNew constant.
DisplayName Optional Variant The display text of the file reference.
Action Optional Variant The action to take when a user clicks the item. Can be any msoFileNew constant.

Remarks

The arguments supplied to the Remove method must match the arguments that were supplied to the Add method of the NewFile object, or the Remove method will fail.

For example, if the Action argument was supplied when the NewFile object was added, the same Action argument must be supplied to remove the NewFile object, or the Remove method will fail.

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.