FileName Property

Applies To

Assistant object, FileSearch object.

Description

Assistant object: Returns or sets the name of the file for the active Office Assistant. Read/write String.

FileSearch object: Returns or sets the name of the file to look for during a file search. The name of the file may include the * (asterisk) or ? (question mark) wildcards. Use the question mark wildcard to match any single character. For example, type gr?y to match both "gray" and "grey." Use the asterisk wildcard to match any number of characters. For example, type *.txt to find all files that have the .TXT extension. Read/write String.

Remarks

In Windows, the file name extension for Assistant files is .act, and the files are installed in the \Program Files\Microsoft Office\Office\Actors folder in Windows 95, in the \Windows\MsApps\Actors folder in Windows NT, and in the Microsoft:Assistants folder on the Macintosh.

The following file names correspond to the Assistants in Office 97.

Character

File name

Office Logo

Logo.act

PowerPup

Powerpup.act

The Genius

Genius.act

Hoverbot

Hoverbot.act

Scribble

Scribble.act

The Dot

Dot.act

Clippit

Clippit.act

Mother Nature

MNature.act

Will

Will.act


See Also

Animation property.

Example

This example uses the FileName property to customize balloon text for specific Office Assistants. The variable btext can be used for the value of the Text property in a Print Wizard balloon.

Select Case Assistant.FileName
Case "will.act"
    btext = "To Print, or Not to Print. That is the question."
Case "genius.act"
    btext = "The sum of the checkboxes equals the document to print."
Case Else
    btext = "Choose the document you want to print."
End Select
This example searches for all files located in the My Documents folder that begin with "cmd." The example displays the name and location of each found file.

Set fs = Application.FileSearch
With fs
    .LookIn = "C:\My Documents"
    .FileName = "cmd*"
    If .Execute > 0 Then
        MsgBox "There were " & .FoundFiles.Count & _
            " file(s) found."
        For i = 1 To .FoundFiles.Count
            MsgBox .FoundFiles(i)
        Next i
    Else
        MsgBox "There were no files found."
    End If
End With