Connect Method
Applies To
System object.
Description
In Windows, establishes a connection to a network drive. On the Macintosh, Connect isn't available and generates an error; use the MountVolume method instead.
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
See Also
MountVolume method.
Example
This example establishes a connection to a network drive (\\Project\Info) protected with the password "smiley" and assigns the network drive to the next available drive letter.
System.Connect Path:="\\Project\Info", Password:="smiley"
This example establishes a connection to a network drive (\\Team1\Public) and assigns the network drive to the third available drive letter.
System.Connect Path:="\\Team1\Public", Drive:=2