FeatureInstall Property

Microsoft Word Visual Basic

FeatureInstall Property

       

Returns or sets how Microsoft Word handles calls to methods and properties that require features not yet installed. Read/write MsoReatureInstall.

Can be one of the following MsoFeatureInstall constants.

Constant Value Description
msoFeatureInstallNone 0 The default value. A generic Automation error is generated at run time when uninstalled features are called.
msoFeatureInstallOnDemand 1 The user is prompted to install new features.
msoFeatureInstallOnDemandWithUI 2 A progress meter is displayed during installation. The user isn't prompted to install new features.

expression.FeatureInstall

expression   Required. An expression that returns one of the objects in the Applies To list.

Remarks

You can use the msoFeatureInstallOnDemandWithUI constant to prevent users from believing that the application isn't responding while a feature is being installed. Use the msoFeatureInstallNone constant if you want the developer to be the only one who can install features.

If you have the DisplayAlerts property set to False, users will not be prompted to install new features even if the FeatureInstall property is set to msoFeatureInstallOnDemand. If the DisplayAlerts property is set to True, an installation progress meter will appear if the FeatureInstall property is set to msoFeatureInstallOnDemand.

Example

This example activates a new instance of Microsoft Excel and checks the value of the FeatureInstall property. If the property is set to msoFeatureInstallNone, the code displays a message box that asks the user whether they want to change the property setting. If the user responds "Yes," the property is set to msoFeatureInstallOnDemand. For this example to function properly, you must add a reference to Microsoft Excel Object Library in the References dialog (Tools menu).

Dim ExcelApp As New Excel.Application
Dim intReply As Integer

With ExcelApp
    If .FeatureInstall = msoFeatureInstallNone Then
        intReply = MsgBox("Uninstalled features for " _
            & "this application may " & vbCrLf _
            & "cause a run-time error when called." _
            & vbCrLf & vbCrLf _
            & "Would you like to change this setting" & vbCrLf _
            & "to automatically install missing features?", _
            vbYesNo, "Feature Install Setting")
        If intReply = vbYes Then
            .FeatureInstall = msoFeatureInstallOnDemand
        End If
    End If
End With