CommandID Constants

Specifies common Device and Item commands as String versions of GUIDs.

Constant/value Description
CommandID for Synchronize. Causes the device driver to synchronize cached items with the hardware device.
CommandID for Take Picture. Causes a WIA device to acquire an image.
CommandID for Delete All Items. Notifies the device to delete all items that can be deleted from the device.
CommandID for Change Document. Causes the document scanner to load the next page in its document handler. Does not apply to other device types.
CommandID for Unload Document. Notifies the document scanner to unload all remaining pages in its document handler. Does not apply to other device types.


Use a CommandID Constants constant as the value for the CommandID parameter for the ExecuteCommand (Device) and ExecuteCommand (Item) methods. You can also use a CommandID Constants constant as the value of the CommandID properties in a DeviceCommand object.

The following example shows how to signal a camera to take a picture if the device selected is a camera.

Dim dev 'As Device

Set dev = CommonDialog1.ShowSelectDevice

If dev.Type = CameraDeviceType Then
    Dim itm 'As Item
    Set itm = dev.ExecuteCommand(wiaCommandTakePicture)
End If

Similar to the previous code example, the following example shows how to determine if the selected device supports the wiaCommandTakePicture command.

Dim dev 'As Device
Dim dc 'As DeviceCommand

Set dev = CommonDialog1.ShowSelectDevice
For Each dc In dev.Commands
    If dc.CommandID = wiaCommandTakePicture Then
        MsgBox "Selected device supports the TakePicture command"
    End If
End If


Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2003 R2 [desktop apps only]

See also