Remove Method

Microsoft Office Object Model

Show All

Remove Method

       

Remove method as it applies to the NewFile object.

Removes an item from the New Item task pane. Returns a Boolean.

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

expression   Required. An expression that returns a NewFile object.

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 msoFileNewSection constant.

DisplayName  Optional Variant. The display text of the file reference.

Action  Optional Variant. The action taken when a user clicks on the item. Can be any msoFileNewAction constant.

Remove method as it applies to the FileTypes, PropertyTests, and SearchFolders objects.

Removes the specified object from the collection.

expression.Remove(Index)

expression   Required. An expression that returns one of the above objects.

Index  Required Long. The index number of the property test to be removed.

Example

As it applies to the FileTypes, PropertyTests, and SearchFolders objects.

This example removes the first search criterion from the collection.

Application.FileSearch.PropertyTests.Remove(1)

As it applies to the NewFile object.

This example removes the specified item from Word's NewDocument task pane.

Sub RemoveDocFromTaskPane()
    Application.NewDocument.Remove FileName:="C:\Newfile.doc", _
            Section:=msoNewfromTemplate, DisplayName:="NewFile"
    CommandBars("Task Pane").Visible = True
End Sub