Open IE from link in Custom contact form

K

Kez

Hi,

I have a custom contact form and want to be able to open
the user's browser at a certain map website. I also need
this link to be populated by the contact's zip/postal
code to show the location.

I've tried using VBA code to populate a text field but it
only populates the field with today's date!

I.E. http://www.mapsite.com/cgi?pc=[Zip/Postcode]

Please help!
 
K

Kez

Thanks for the links - I've used code behind a label
control using the tag property. I've used the
PropertyChange event as follows:

Sub Item_PropertyChange(ByVal Name)
Select Case Name
Case "Postcode"
MyValue = objItem.MailingAddressPostalCode
End Select
End Sub
Sub Label1_Click()
Set objWeb = CreateObject
("InternetExplorer.Application")
objWeb.Navigate Item.GetInspector.ModifiedFormPages _
("P.3").Controls("Label1").Tag
objWeb.Visible = True
End Sub

But I still can't bring in this selection into the link.
Do you know a way around this or is this the wrong method
to achieve my goal?

Thanks
-----Original Message-----
You'll need to write code to do this, not just a URL.
See http://www.slipstick.com/dev/tips/formhyperlink.htm
and, if you don't know how to access Outlook property
values, http://www.slipstick.com/dev/propsyntax.htm
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers



"Kez" <[email protected]> wrote in
message news:[email protected]...
Hi,

I have a custom contact form and want to be able to open
the user's browser at a certain map website. I also need
this link to be populated by the contact's zip/postal
code to show the location.

I've tried using VBA code to populate a text field but it
only populates the field with today's date!

I.E. http://www.mapsite.com/cgi?pc=[Zip/Postcode]

Please help!
.
 
S

Sue Mosher [MVP]

I don't understand what you mean by "bring in this selection into the link" or what you're trying to do with the PropertyChange code, since you're not doing anything with MyValue. What you need to do is use the postal code to create the string with the web page you want to navigate to:

Sub Label1_Click()
Set objWeb = CreateObject("InternetExplorer.Application")
MyValue = "http://www.mapsite.com/cgi?pc=" & _
objItem.MailingAddressPostalCode
objWeb.Navigate MyValue
objWeb.Visible = True
End Sub


--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers



Kez said:
Thanks for the links - I've used code behind a label
control using the tag property. I've used the
PropertyChange event as follows:

Sub Item_PropertyChange(ByVal Name)
Select Case Name
Case "Postcode"
MyValue = objItem.MailingAddressPostalCode
End Select
End Sub
Sub Label1_Click()
Set objWeb = CreateObject
("InternetExplorer.Application")
objWeb.Navigate Item.GetInspector.ModifiedFormPages _
("P.3").Controls("Label1").Tag
objWeb.Visible = True
End Sub

But I still can't bring in this selection into the link.
Do you know a way around this or is this the wrong method
to achieve my goal?

Thanks
-----Original Message-----
You'll need to write code to do this, not just a URL.
See http://www.slipstick.com/dev/tips/formhyperlink.htm
and, if you don't know how to access Outlook property
values, http://www.slipstick.com/dev/propsyntax.htm
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers



"Kez" <[email protected]> wrote in
message news:[email protected]...
Hi,

I have a custom contact form and want to be able to open
the user's browser at a certain map website. I also need
this link to be populated by the contact's zip/postal
code to show the location.

I've tried using VBA code to populate a text field but it
only populates the field with today's date!

I.E. http://www.mapsite.com/cgi?pc=[Zip/Postcode]

Please help!
.
 
K

Kez

Thanks v much, that's exactly what I was after.
-----Original Message-----
I don't understand what you mean by "bring in this
selection into the link" or what you're trying to do with
the PropertyChange code, since you're not doing anything
with MyValue. What you need to do is use the postal code
to create the string with the web page you want to
navigate to:
Sub Label1_Click()
Set objWeb = CreateObject ("InternetExplorer.Application")
MyValue = "http://www.mapsite.com/cgi?pc=" & _
objItem.MailingAddressPostalCode
objWeb.Navigate MyValue
objWeb.Visible = True
End Sub


--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers



"Kez" <[email protected]> wrote in
message news:[email protected]...
Thanks for the links - I've used code behind a label
control using the tag property. I've used the
PropertyChange event as follows:

Sub Item_PropertyChange(ByVal Name)
Select Case Name
Case "Postcode"
MyValue = objItem.MailingAddressPostalCode
End Select
End Sub
Sub Label1_Click()
Set objWeb = CreateObject
("InternetExplorer.Application")
objWeb.Navigate Item.GetInspector.ModifiedFormPages _
("P.3").Controls("Label1").Tag
objWeb.Visible = True
End Sub

But I still can't bring in this selection into the link.
Do you know a way around this or is this the wrong method
to achieve my goal?

Thanks
-----Original Message-----
You'll need to write code to do this, not just a URL.
See http://www.slipstick.com/dev/tips/formhyperlink.htm
and, if you don't know how to access Outlook property
values, http://www.slipstick.com/dev/propsyntax.htm
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers



"Kez" <[email protected]> wrote in
message news:[email protected]...
Hi,

I have a custom contact form and want to be able to open
the user's browser at a certain map website. I
also
need
this link to be populated by the contact's zip/postal
code to show the location.

I've tried using VBA code to populate a text field
but
it
only populates the field with today's date!

I.E. http://www.mapsite.com/cgi?pc=[Zip/Postcode]

Please help!
.
.
 

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

Top