Connect Method

         Example         Applies To

Establishes a connection to a network drive.

Syntax

expression.Connect(Path, Drive, Password)

expression   Required. An expression that returns a System object.

Path   Required String. The path for the network drive (for example, "\\Project\Info").

Drive   Optional Variant. A number corresponding to the letter you want to assign to the network drive, where 0 (zero) corresponds to the first available drive letter, 1 corresponds to the second available drive letter, and so on. If this argument is omitted, the next available letter is used.

Password   Optional Variant. The password, if the network drive is protected with a password.

Remarks

Use the Dialogs property with the wdDialogConnect constant to display the Connect To Network Drive dialog box. The following example displays the Connect To Network Drive dialog box, with a preset path shown.

With Dialogs(wdDialogConnect)
    .Path = "\\Marketing\Public"
    .Show
End With