-
Jun 27th, 2024, 08:50 PM
#1
Thread Starter
PowerPoster
VB6 GET ALL Printers name and Do Menu Click
Shell.Application, just like a folder, can list all the subitems and submenus, and then you can click on them. It's very fun.
I wonder if anyone is studying the development under LINUX, such as VisualFBEditor, WinFBE and Visual Free Basic.
It would be very convenient if all menus and functions under LINUX can also make a Shell.Application.
TWINBASIC developed all the objects of VB6.
VBA.*
PRINT.*
USERCONTROL
If we can realize the functions like WINDOWS registry, Shell.Application, WMI, etc., it would be perfect to develop with the idea similar to WINDOWS.
Code:
Function GetPrintList() As String()
Dim sh, I
Dim JH As New Collection
Set sh = CreateObject("Shell.Application")
For Each I In sh.NameSpace(4).Items
Debug.Print "print:" & I.Name
JH.Add I.Name
Next
Dim sARR() As String
If JH.Count = 0 Then
ReDim sARR(-1 To -1)
Else
ReDim sARR(JH.Count - 1)
Dim a As Long
For a = 0 To JH.Count - 1
sARR(a) = JH.Item(a + 1)
Next
End If
GetPrintList = sARR
End Function
Function GetPrintMenuList(PrintName As String) As String()
Dim sh, I, VS
Dim JH As New Collection
Set sh = CreateObject("Shell.Application")
For Each I In sh.NameSpace(4).Items
Debug.Print "PrintName:" & I.Name
If I.Name = PrintName Then
For Each VS In I.Verbs
JH.Add VS.Name
'menu item=VS.Name
'If VS.Name = "***" Then VS.doit
Next
Exit For
End If
Next
Dim sARR() As String
If JH.Count = 0 Then
ReDim sARR(-1 To -1)
Else
ReDim sARR(JH.Count - 1)
Dim a As Long
For a = 0 To JH.Count - 1
sARR(a) = JH.Item(a + 1)
Next
End If
GetPrintMenuList = sARR
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|