Custom Contacts: Linking button to website

Status
Not open for further replies.

JudyLou

Member
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server
Trying to edit custom contact form so user hits a button which takes them to a website. Problem is the macro works, but the button doesn't. Note that I have not bound the buttons to any fields because I don't know which field type to use.

Can you see anything that would cause this?


Using this code:

Sub GoogleContacts_Click()

Dim Browser As Object

Set Browser = CreateObject("InternetExplorer.Application")

Browser.Navigate "http://Contacts.google.com <http://contacts.google.com/> "

Browser.Visible = True

End Sub

Sub Yelp_Click()

Dim Browser As Object

Set Browser = CreateObject("InternetExplorer.Application")

Browser.Navigate ("http://www.Yelp.com <http://www.yelp.com/> ")

Browser.Visible = True

End Sub

and then....

Sub Yelp_Click()

Dim Browser As Object

Set Browser = CreateObject("InternetExplorer.Application")

With Browser

> Visible = True

> Navigate "http://www.Yelp.com"

Do Until .ReadyState = 4: DoEvents: Loop

End With

End Sub
 
This worked for me on a commandbutton

Button name: Yelp

Sub Yelp_Click()

Set Browser = CreateObject("InternetExplorer.Application")

With Browser

> Visible = True

> Navigate "http://www.Yelp.com"

Do Until .ReadyState = 4
Loop

End With

End Sub
 
So, for some reason it doesn't work when the code is located in the VB module but only works with it is "View Code" any ideas as to why or does it even matter?

This worked for me on a commandbutton

Button name: Yelp

Sub Yelp_Click()

Set Browser = CreateObject("InternetExplorer.Application")

With Browser

> Visible = True

> Navigate "http://www.Yelp.com"

Do Until .ReadyState = 4
Loop

End With

End Sub
 
View code is vbscript, while a module is full VB and there are some differences. One diff is that you don't need to dim objects. And it doesn't use DoEvents. :)

Your first yelp_click worked fine in a userform in the VB editor (I didn't text it in a module) but it errored in the vbscript editor (view code).
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
G Apply Custom Contacts form to all existing Contacts Outlook VBA and Custom Forms 1
G Add Map It button to Custom Contacts Form in Outlook Outlook VBA and Custom Forms 1
K Font Sizing in Custom Form Regions for Contacts Outlook VBA and Custom Forms 1
K can't get custom form to update multiple contacts using VBA Outlook VBA and Custom Forms 3
M VbScript for Command Button on Contacts Custom Form Using Outlook 1
Q Custom Contact Form - applied to existing contacts Outlook VBA and Custom Forms 5
M Outlook 2013 won't convert Excel contacts into Outlook contacts using my custom form Using Outlook 3
S Seeing Custom Fields in Contacts (Outlook 2010) Using Outlook 0
C Custom Form Outlook 2010 Contacts Using Outlook 3
C Contacts Button on Custom Form Using Outlook 1
R VB Referring to a custom contacts folder Exchange Server Administration 4
M Custom print contacts Using Outlook 2
C How to Set Existing Contacts to Custom Form Using Outlook 2
L Adding custom labels in Contacts BCM (Business Contact Manager) 1
A New Contact entry (custom form) get saved in a public folder and doesn't appear in Outolook Contacts Outlook VBA and Custom Forms 3
A Help creating custom Contacts form - what type is 'Email' control? Outlook VBA and Custom Forms 1
B Importing Contacts Does Not Use Defined Custom Form in Outlook 2007 Outlook VBA and Custom Forms 1
sjbtax Update Task Custom Field based upon Task Overdue Status Outlook VBA and Custom Forms 8
boblewis Technical Issue with Custom Form - Save to Drafts Not Syncing Outlook VBA and Custom Forms 1
G Outlook 2021 Add Picture to Custom Contact Form Outlook VBA and Custom Forms 2
X Custom icon (not from Office 365) for a macro in Outlook Outlook VBA and Custom Forms 1
P Can't add custom field to custom Outlook form, it always adds to the Folder instead Outlook VBA and Custom Forms 2
AndyZ Contact Custom Form Tiny Text Outlook VBA and Custom Forms 3
A How to reduce size of custom contact form? Outlook VBA and Custom Forms 3
S Custom Contact card - need help creating one Outlook VBA and Custom Forms 1
S Outlook 2019 Custom outlook Add-in using Visual Studio Outlook VBA and Custom Forms 0
S Adding Custom Forms Outlook VBA and Custom Forms 4
Witzker How to get the button Karte ( map) in custom contact form Outlook VBA and Custom Forms 2
B Outlook 2019 Custom Email form - Edit default email form Outlook VBA and Custom Forms 6
D Outlook 365 Custom forms field limit? Outlook VBA and Custom Forms 4
J PSA: How to create custom keyboard shortcut for "Paste Unformatted Text" in Outlook on Windows Outlook VBA and Custom Forms 1
M copy field value to custom field Outlook VBA and Custom Forms 0
J Does the .fdm contain my custom form? How to make ol use it? - ol2007 Outlook VBA and Custom Forms 4
J ol2021 custom form not displaying pics Outlook VBA and Custom Forms 37
N "Perform a Custom Action" Outlook VBA and Custom Forms 0
cbufacchi Outlook 365 Populate custom Outlook Appoint form Outlook VBA and Custom Forms 2
C Create Meeting With Custom Form Outlook VBA and Custom Forms 2
FryW Need help modifying a VBA script for in coming emails to auto set custom reminder time Outlook VBA and Custom Forms 0
J custom form not displaying pictures Outlook VBA and Custom Forms 7
I Button PDF in Outlook Contact custom form Outlook VBA and Custom Forms 1
V Update new custom field Outlook VBA and Custom Forms 5
D Anyone tell me where custom view settings are stored? Outlook VBA and Custom Forms 9
S Outlook 2016 Arrange tasks by date, additional custom sorting, but still use friendly terms like Today, Tomorrow, This week? Using Outlook 1
H Custom Outlook Contact Form VBA Outlook VBA and Custom Forms 1
S Custom Field Cannot Be Displayed In Views Outlook VBA and Custom Forms 2
D Custom Search Folders not refreshing/updating automatically Using Outlook 0
F Validation on custom task form after task acceptance Outlook VBA and Custom Forms 1
K UDF with formula not showing on Calendar custom view. Outlook VBA and Custom Forms 0
S Create a clickable custom column field Outlook VBA and Custom Forms 0
I Error saving screenshots in a custom form in outlook 2016, outlook 365 - ok in outlook 2013, outlook 2010 Outlook VBA and Custom Forms 5

Similar threads

Back
Top