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 OLE automation solution



Hi All

Just in case anyone needs it in future or is interested, since my post
last week I have been trying different things and have a solution to my
problem.

If you recall I was trying to fill in a word document with data from the
address book of WHFC using OLE automation, could get the Fax number by
using the ResolveFaxNo function, but the GetInfo function always
returned error 13 type mismatch

============================================================
So here is what I had that did not work
============================================================
Private Sub FaxNumber_Click()

Dim whfc As Object

Set whfc = CreateObject("WHFC.OleSrv")

Dim Alias, Pbook As String
Dim Remarks, VoiceNo, Location, Company, ToName, FaxNo As String
Dim code As Integer
Dim ErrCode As Long


Alias = InputBox("enter name to lookup")

Pbook = whfc.GetPhoneBook(0)

ErrCode = whfc.GetInfo(Alias, Pbook, FaxNo, ToName, _
                        Company, Location, VoiceNo, Remarks, code)

txtCompany.Value = Company
txtFaxNum.Value = FaxNo
txtPhoneNum.Value = VoiceNo
txtAtten.Value = ToName

End Sub

===========================================================
Here is what does work
===========================================================

Private Sub FaxNumber_Click()

Dim whfc As Object

Set whfc = CreateObject("WHFC.OleSrv")

Dim Alias, Pbook As String
Dim Remarks As String
Dim VoiceNo As String
Dim Location As String
Dim Company As String
Dim ToName As String
Dim FaxNo As String
Dim code As Integer
Dim ErrCode As Long


Alias = InputBox("enter name to lookup")

Pbook = whfc.GetPhoneBook(0)

ErrCode = whfc.GetInfo(Alias, Pbook, FaxNo, ToName, _
                        Company, Location, VoiceNo, Remarks, code)

txtCompany.Value = Company
txtFaxNum.Value = FaxNo
txtPhoneNum.Value = VoiceNo
txtAtten.Value = ToName

End Sub

===============================================================



Don’t ask me why, just declared the variables seperately and off it
went, though have to admit it took 5 days to get there and a Java
programmer friend of mine swearing it was a bug in WHFC, but if anyone
has any ideas to why this was needed email me off list I would be
interested to know.


Best Regards

Ian Macdonald


 "I made this letter longer than usual because
I lack the time to make it shorter."
Pascal, Provincial Letters XVI



____________________ 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