ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¦p¦ó¨ú±o¦Lªí¾÷ªºPORT?

[µo°Ý] ¦p¦ó¨ú±o¦Lªí¾÷ªºPORT?

ºô¸ô¤W§ä¨ìªº³£¬O¥ÎApplication.Printer.Port

¦ý¬Ovba¤£¤ä´©

¦]¬°ºô¸ô¦Lªí¾÷ªºport·|§ó°Ê,¾É­PÁöµM¦Lªí¾÷¦WºÙ¬Û¦P

¦ý¬Oport¿ù»~¾É­PµLªk¦C¦L
PKKO

¦^´_ 1# PKKO

¥i°Ñ¦Ò¤@¤U
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE


    ·PÁÂ,³o½gªº¥\¯à¸ò§Úªºµ{¦¡½X¤£¤@¼Ë,§Ú¥Ø«eªº¤è¦¡¥i¥H¦Û°Ê¦C¥X,¤]¥i¥H³z¹Lµ{¦¡¦Û°Ê¿ï¾Ü¦Lªí¾÷¨Ã¥B¥Î´ú¸Õªº¤è¦¡§ä¥Xport,¦ý³o½g¦h¤F¤@­Ó¥\¯à(¼u¸õµøµ¡¿ï¾Ü¦Lªí¾÷!)
  1. Dim reg As Variant, oreg As Object, mystr As Variant
  2.     Const HKEY_CURRENT_USER = &H80000001
  3.     Set oreg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
  4.     oreg.enumvalues HKEY_CURRENT_USER, "Software\Microsoft\Windows NT\CurrentVersion\Devices", mystr, Arr
  5.     For Each reg In mystr
  6.         If Left(reg, Len(Sheets("¨ä¥L").[k2])) = Sheets("¨ä¥L").[k2] Then '§ä¥XÃþ¦ü¦WºÙªº¦Lªí¾÷
  7.             Exit For
  8.         End If
  9.     Next
  10.     '´ú¸Õ¬Ý¬Ý¬O­þ¤@­ÓPort
  11.     For i = 0 To 999
  12.         On Error Resume Next
  13.         If i < 10 Then X = "0" & i Else X = i
  14.         If i = 0 Then
  15.             Application.ActivePrinter = reg & " on nul:"
  16.             If Application.ActivePrinter = reg & " on nul:" Then Exit For
  17.         End If
  18.         Application.ActivePrinter = reg & " on Ne" & X & ":" '³]©w«ü©wªº¦Lªí¾÷
  19.         If Application.ActivePrinter = reg & " on Ne" & X & ":" Then Exit For
  20.     Next
½Æ»s¥N½X
PKKO

TOP

        ÀR«ä¦Û¦b : °µ¦n¨Æ¤£¯à¤Ö§Ú¤@¤H¡A°µÃa¨Æ¤£¯à¦h§Ú¤@¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD