VBScript and ConnectedSubmit when sending faxes

  • Thread starter Martin Kochanski
  • Start date
M

Martin Kochanski

I am using VBScript to send a fax, and I'm following the sample code
given in the Platform SDK:

Set doc=CreateObject("FaxComEx.FaxDocument")
Set server=CreateObject("FaxComEx.FaxServer")
Dim JobID
server.Connect ""
doc.Body="c:\x.tif"
doc.DocumentName="Sample Fax"
doc.Recipients.Add "02076819999"
doc.Priority = 1
JobID = doc.ConnectedSubmit(server)

Everything works, and the fax is sent, but there seems no way of getting
at the content of JobID.

TypeName() reports the type as "String()" and VarType reports 8200 (an
array of vbString), but trying to refer to JobID(0) generates a type
mismatch, and trying something like Join(JobID) produces error 800A01CA
"Variable uses an Automation type not supported in VBScript".

My guess is that VBScript can't handle arrays of strings, only arrays of
Variants. Does anyone have any experience of this? Or any way round the
problem??
 
M

Michael Harris \(MVP\)

---snip---
Everything works, and the fax is sent, but there seems no way of
getting at the content of JobID.

TypeName() reports the type as "String()" and VarType reports 8200 (an
array of vbString), but trying to refer to JobID(0) generates a type
mismatch, and trying something like Join(JobID) produces error
800A01CA "Variable uses an Automation type not supported in VBScript".

My guess is that VBScript can't handle arrays of strings, only arrays
of Variants. Does anyone have any experience of this? Or any way
round the problem??

165967 - PRB: Script Error Occurs When Referencing Non-variant Array
http://support.microsoft.com/default.aspx?kbid=165967

Your only work-around would be to write your own COM component with a
function method that takes a string array and returns a variant array of
strings.

Q250344 - SAMPLE: ARRAYCONVERT.EXE Variant Conversion Functions
http://support.microsoft.com/default.aspx?kbid=250344


--
Michael Harris
Microsoft.MVP.Scripting

Windows 2000 Scripting Guide
Microsoft® Windows®2000 Scripting Guide
http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.asp

TechNet Script Center Sample Scripts
http://www.microsoft.com/downloads/release.asp?ReleaseID=38942

WSH 5.6 documentation download
http://www.microsoft.com/downloads/...48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top