'Diederik de Groot 'mailto:Diederik de Groot 'Talon (www.talon.nl) 'This is a starmacro to connect and disconnect Network Drives from within 'StarOffice (Under Windows). When running staroffice as a shell you need 'to be able to connect network drives. Declare Function WNetConnectionDialog Lib "mpr.dll" (ByVal hwnd As Long, ByVal dwType As Long) As Long Declare Function WNetDisconnectDialog Lib "mpr.dll" Alias "WNetDisconnectDialog" (ByVal hwnd As Long, ByVal dwType As Long) As Long Public Const RESOURCETYPE_DISK = &H1 Public Const RESOURCETYPE_PRINT = &H2 Dim xInterface as object Dim hWnd as Long Sub Main() xInterface = createUnoService("com.sun.star.uno.XInterface") hWnd = xInterface.getWindowHandle(SystemDependentWIN32) End Sub Sub ShowMapPrinters () WNetConnectionDialog (hWnd, RESOURCETYPE_PRINT) End Sub Sub CancelPrinterMapping() WNetDisconnectDialog (hWnd, RESOURCETYPE_PRINT) End Sub Sub ShowMapDrives() WNetConnectionDialog (hWnd, RESOURCETYPE_DISK) End Sub Sub CancelDriveMapping() WNetDisconnectDialog (hWnd, RESOURCETYPE_DISK) End Sub