HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

[hylafax-users] WHFC - VBA Script problem



Hi All

Thank you all for the response on WHFC and Windows XP, it all works and
is great.

I have a small problem and perhaps this is not the right place to ask,
but..........

Having got WHFC working fine from Word, when the user opens the template
for a fax it requests all the details and all they have to worry about
is the message, then press send and the script calls WHFC to send the
fax.

I added a module to look up the fax number in the WHFC phone book which
is maintained for the users and as such gives us a central point for
errors in Fax numbers, when sending faxes to known clients, which for us
is a large percentage of our faxes.

First part went fine as follows:

Dim Alias, pbook, faxnum As String
Dim whfc As Object
Dim code as Int
Set whfc = CreateObject("WHFC.OleSrv")

Alias = InputBox("enter name to lookup")
pbook = whfc.GetPhoneBook(0)

Faxno = whfc.ResolveFaxNo(Alias, pbook, code)
txtFaxNum.Value = Faxno


Now the user can open a template, press a button, enter an alias and the
fax number is placed in the document for them, they fill in the text and
the rest of the details and press a button and of it goes.

Great next step, lets get all the details from the phone book, place
them in the correct place in the document and now all they have to do is
write the message and press send, provided the entity exists in the
phone book.

So I added the following..........

Dim Faxno, Company, ToName, Location, VoiceNo, Remarks As String
Dim OLE_Return As Long
OLE_Return = whfc.GetInfo(Alias, pbook, Faxno, ToName, Company,
Location, VoiceNo, Remarks, code)

It does not work, error 13 type mismatch

Changed the variables to Variant, same problem, declared them as public,
same problem.

I am lost, I am not a programmer and although my users are intelligent
people a fax is just a tool to them, so the quicker, easier and error
free it is to send the better for all concerned.

I have looked at the source code for WHFC and also the examples on the
website. From the research I have done it looks like the variables for
'FaxNo' 'ToName' 'Company' 'Location' 'VoiceNo'  & 'Remarks' are
declared differently as far pointers to a BSTR.  But all the
documentation I have indicates what I have done is OK and as 3 of OLE
Automation functions are running OK it is confusing.  A search on the
web indicates older versions of VBA would need to have the function
declared and the variables defined, but everything I have does not
indicate how I would do this in VBA on Office 2002 nor does the WHFC
indicate how, if I knew how the alias thing worked I may have a chance
of declaring it :-(


For a bit of back ground information the server is Redhat 8 and Hylafax
4.1.5 and Windows XP and Office XP is on all clients, there is a web
server running which also gives users fax from a web page facility,
SquirrelMail is used so fax reports are sent to the individual, all
received faxes go to the receptionist as attachments and she can forward
them via email to the correct person, Samba Fax is also working.

Best Regards

Ian Macdonald




____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@hylafax.org.*




Project hosted by iFAX Solutions