Represents a collection of Job objects.
Submits a job to the queue.
object.AddElement(
fileName As String,
[format As String])
The name of the file that contains the job.
Optional. The printer-specific format in which to print the job.
Boolean. Returns TRUE if successful. Otherwise, FALSE.
An optional format string that can be specified for the job server to use. The nature of the contents of this parameter depend on the job server. The maximum size for this parameter is 152 bytes.
This example adds textfile.txt to the queue Sample_Job_Queue. Ensure that the specified queue is existing.
Set Queue = CreateObject("ucx:Queue")
Queue.Name = "Sample_Job_Queue"
Set Jobs = Queue.Jobs
Jobs.AddElement("sys:temp\textfile.txt")
Creates a new job in the queue.
object.Create()
None.
Job.
You may need to use the JobFile property to get the File object, and then write the data. Use the Post method to submit the Job.
This example creates a new job in the queue Sample_Job_Queue. Ensure that the specified queue is existing.
Set Queue = CreateObject("ucx:Queue")
Queue.Name = "Sample_Job_Queue"
Set Jobs = Queue.Jobs
Set Jobobj = Jobs.Create()
Finds a Job object by job number.
object.Element(
JobNumber As Long)
The number of the job to find.
Job. Returns the job associated with the specified job number.
This example finds the job associated with job number 1in the queue Sample_Job_Queue. Ensure that the specified queue is existing.
JobNumber = 1
Set Queue = CreateObject("ucx:Queue")
Queue.Name="Sample_Job_Queue"
Set Jobs=Queue.Jobs
Set Job=Jobs.Element(JobNumber)
Print("Name of the first job is: & Job.JobName)
Determines whether or not the collection contains any more Job objects.
object.HasMoreElements()
None.
Boolean. Returns TRUE if the collection contains more Job objects. Otherwise, FALSE.
This example determines whether there are any more jobs objects in the queue Sample_Job_Queue. Ensure that the specified queue is existing.
Set Queue = CreateObject("ucx:Queue")
Queue.Name = "Sample_Job_Queue"
Set Jobs = Queue.Jobs
Jobs.Reset
Print("The queue has the following jobs:")
While(Jobs.HasMoreElements=TRUE)
Set Job=Job.Next
Print(Job.JobName)
Wend
Returns the next Job object in the collection.
object.Next()
None.
Job. Returns the next Job object in the collection.
This example returns the next Job in the queue Sample_Job_Queue. Ensure that the specified queue is existing.
Set Queue = CreateObject("ucx:Queue")
Queue.Name = "Sample_Job_Queue"
Set Jobs = Queue.Jobs
Jobs.Reset
Print("The queue has the following jobs:")
While(Jobs.HasMoreElements=TRUE)
Set Job=Job.Next
Print(Job.JobName)
Wend
Opens a queued job.
object.Open(
[JobType As Integer])
Optional. A specific job to open. If this parameter is not specified, the first job in the queue is opened.
See Remarks below.
Job. Returns the job name if it is successfully opened.
You may need to (1) use the JobFile property to get the FILE object, (2) read the data from file object, then (3) call the Close method to remove the job from the queue.
The JobType value depends on the job server and client. JobType is a number that tells the job server what type of job is represented by the job entry. A job server can request specific job types from a queue when making a request to service a job. The JobType is a value agreed upon by the client and the job server. For example, JobType could be used to signal which paper tray to use in a printer.
This example opens the first job in the queue Sample_Job_Queue. Ensure that the specified queue is existing
Set Queue = CreateObject("ucx:Queue")
Queue.Name = "Sample_Job_Queue"
Set Jobs = Queue.Jobs
Set Job.Open
Deletes the specified job from a queue.
object.RemoveElement(
[JobNumber As Long])
Optional. The number of the job to remove. If this parameter is not specified, it removes the first job in the queue.
Boolean. Returns TRUE if the job is successfully removed. Otherwise, FALSE.
This example removes the first job from the queue.
Set Queue = CreateObject("ucx:Queue")
Set Jobs = Queue.Jobs
Jobs.RemoveElement()
Resets the collection of Job objects.
object.Reset()
None.
Void.
This example resets the collection of Job objects in the queue Sample_Job_Queue. Ensure that the specified queue is existing.
Set Queue = CreateObject("ucx:Queue")
Queue.Name = "Sample_Job_Queue"
Set Jobs = Queue.Jobs
Jobs.Reset
Print("The queue has the following jobs:")
While(Jobs.HasMoreElements=TRUE)
Set Job=Job.Next
Print(Job.JobName)
Wend
Retrieves a job from the queue into a file.
object.Retrieve(
FileName As String,
[JobType As Integer])
The name of the file in which the job is to be retrieved.
Optional. The type of job to retrieve. If this parameter is not specified, this method retrieves the first job in the queue. See Remarks below.
Boolean. Returns TRUE if the file is successfully retrieved. Otherwise, FALSE.
The JobType value depends on the job server and client. JobType is a number that tells the job server what type of job is represented by the job entry. A job server can request specific job types from a queue when making a request to service a job. The JobType is a value agreed upon by the client and the job server. For example, JobType could be used to signal which paper tray to use in a printer.
This example retrieves the first job in the queue and places it in file text.txt.
Set Queue = CreateObject("ucx:Queue")
Set Jobs = Queue.Jobs
Jobs.Retrieve("text.txt",JobType)