|
以下を訂正です。
>'=======================================================
>' プリンター名i/oプロシジャーパック
>'=======================================================
>Dim folds
>Dim pr_array() As String
>Dim pr_idx()
>'=======================================================
>Function open_printer() As Boolean
>'プリンター名をpr_arrayに、FolderitemのIDをpr_idx()にセット
>' output open_printer true 正常終了
>' false 異常終了
On Error Goto err_open_printer
> Dim myshell
> open_printer = True
> Erase pr_array
> Erase pr_idx
> Set myshell = CreateObject("shell.application")
> Set fol = myshell.NameSpace(4)
> Set folds = fol.items
> idx = 0: jdx = 1
> Do While idx <= folds.Count - 1
> Set fold = folds.Item(idx)
> If Not fold.Name Like "プリンタ*" Then
> ReDim Preserve pr_array(1 To jdx)
> pr_array(jdx) = fold.Name
> ReDim Preserve pr_idx(1 To jdx)
> pr_idx(jdx) = idx
> jdx = jdx + 1
> End If
> idx = idx + 1
> Loop
>ret_open_printer:
> Set myshell = Nothing
> On Error GoTo 0
> Exit Function
>err_open_printer:
> MsgBox Error$(Err.Number)
> open_printer = False
> Resume ret_open_printer
>End Function
|
|