|
Add button to your Application, to
activate the Postcode Address search, using
the following code. VB.NET/Visual
Basic Postcode Address Search Code: 'Open
Postcode Address Search object to perform search
Dim LookupSoftware As Object
Set LookupSoftware = GetObject("", "COMAddress.Lookup")
With LookupSoftware
' US=Zip code search,UK=Postcode address Search
.SearchType = "UK"
'To prime search box from your application
.SearchPrima = ""
'Set search window Title
.SearchTitle = "Search Example"
'Show Address Search window
If .SearchForCode() Then
'Fill in returned address data
Me.Company = .CompanyName
Me.Line1 = .Line1
Me.Line2 = .Line2
Me.Line3 = .Line3
Me.Town = .Town
Me.County = .CountyState
Me.Postcode = .PostZipCode
Me.Country = .Country
'The following are for UK Only
Me.DeliveryPointSuffix = .DeliveryPointSuffix
Me.nohouseholds = .nohouseholds
Me.smallorg = .smallorg
Else
'Postcode Address Search cancelled
End If
End With
COMAddress.Lookup is a COM
object, which in the above example is being used in VB, but the same
object could easily be used with VB.NET, Delphi, and another
language which allows you to create and use a COM object.
The above code will call our standard address lookup desktop
application which is running in the background.
This has the advantage
that the address lookup search window can be used with other
applications which the user may be using.
Our Postcode lookup service is
"Black Box" Lookup Service. Or in other words,
simply add it to your software, and install on client PC's. We
take care of all the management tasks. Royal
Mail PostZon
Data can be obtained by calling function SearchForCodeWithGeoData().
The Desktop client will switch between Full and Thoroughfare data
according to the customers licenses. Note:
Some Postcodes return no PostZon Data, such as PO Boxes. It is
a good idea to test your program against such postcodes.
Examples are AB10 1BH, AB10 1DQ, AB10 1DU, AB10 1EP Royal
Mail PAF Thoroughfare licenses The
Desktop Client can be forced to
always use a Thoroughfare License by selecting "Options
>> Use Thoroughfare License" menu, or it will default to
PAF Thoroughfare License if thats the license you have bought. The
COM Object can be forced to perform a Royal Mail PAF Thoroughfare License
address search, and simply return the data, allowing you to ask for
the Building Name, by setting .SearchType =
"UKT" Alternatively
you can use the HTTP/XML Service to get Thoroughfare Address without
using the COM Object
[More info on
HTTP/XML Web Service] The
Desktop Client can be forced to
always use a Thoroughfare License by selecting "Options
>> Use Thoroughfare License" menu. This allows some
certain users to use the Royal Mail Full PAF Liciense, and other
users use the Royal Mail Thoroughfare License.
[What
is Full, Thoroughfare
and PostZon Data?]
|