Outlook 2007 Contact Form Webpage

Status
Not open for further replies.

LMS

Senior Member
Outlook version
Email Account
Exchange Server
In my form of contacts, I have the regular field of the webpage of the contact. Is there a way to add to the contact form, a second field with is for a different webpage?
 

LMS

Senior Member
Outlook version
Email Account
Exchange Server
I found the following code that as a macro, opens up a webpage based on the webpage name you put in.
Since I have in my contact form, a UserProperties field which I type in the webpage as a text word, not a link, can I change this code so the Browser.Navigate recognized the text words from the field called "Second Webpage"which could be objItem.UserProperties("Second WebPage")?

Here is the code if it can be changed please:

Private Sub WebPage()
Set Browser = CreateObject("InternetExplorer.Application")
Browser.Navigate ("www.microsoft.com")
Browser.StatusBar = False
Browser.Toolbar = False
Browser.Visible = True
Browser.Resizable = False
Browser.AddressBar = False
End Sub
 

LMS

Senior Member
Outlook version
Email Account
Exchange Server
Thanks much. I tried both, but each line of Browser.Navigate ( objItem.UserProperties("Second WebPage")) using it, or strUrl = objItem.UserProperties("Second WebPage") using it show in macro as yellow...no words of a problem, but did not do it....anything to fix please....the Display Name of the field is TextBox40......is there way to use that and fix the code maybe?
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
did you dim the strUrl as a string?

i use similar code to open a url in the subject field of tasks.
 

LMS

Senior Member
Outlook version
Email Account
Exchange Server
So I should try this???

Private Sub WebPage()

Dim strUrl as String
Set Browser = CreateObject("InternetExplorer.Application")
strUrl = objItem.UserProperties("Second WebPage")
Browser.Navigate (strUrl) Browser.StatusBar = False
Browser.Toolbar = False
Browser.Visible = True
Browser.Resizable = False
Browser.AddressBar = False
End Sub
 

LMS

Senior Member
Outlook version
Email Account
Exchange Server
The actual field name is LinkedIn Webpage....and I did this, but the same yellow shows up:

Private Sub WebPage2()

Dim strUrl As String
Set Browser = CreateObject("InternetExplorer.Application")
strUrl = objItem.UserProperties("LinkedIn Webpage")
Browser.Navigate (strUrl)
Browser.StatusBar = False
Browser.Toolbar = False
Browser.Visible = True
Browser.Resizable = False
Browser.AddressBar = False
End Sub
 

LMS

Senior Member
Outlook version
Email Account
Exchange Server
I looked at what you gave me before that it is part of a different code and runs if I open up the contact...so I addd to this code what you will see below, and when I open the contact and run the macro, it goes to the webpage from the words of that field.....and this can be helpful to others, as there is not way I know to add a second field to the contact form that is a hyperlink....

Private Sub WebPage2()

Dim strUrl As String
Dim objItem As Object


Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")

On Error Resume Next

If TypeName(objApp.ActiveWindow) = "Inspector" Then
Set objItem = objApp.ActiveInspector.currentItem

Set Browser = CreateObject("InternetExplorer.Application")
strUrl = objItem.UserProperties("LinkedIn Webpage")
Browser.Navigate (strUrl)
Browser.StatusBar = False
Browser.Toolbar = False
Browser.Visible = True
Browser.Resizable = False
Browser.AddressBar = False

End If
End Sub
 

LMS

Senior Member
Outlook version
Email Account
Exchange Server
In addtion, the foregoing did not work when I selected a contact and did not open the contact up....so I just did the followng and it works if I open the contact or just select the contact:

Private Sub WebPage3()

Dim strUrl As String
Dim objItem As Object


Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")

On Error Resume Next

If TypeName(objApp.ActiveWindow) = "Inspector" Then
Set objItem = objApp.ActiveInspector.currentItem

Set Browser = CreateObject("InternetExplorer.Application")
strUrl = objItem.UserProperties("LinkedIn Webpage")
Browser.Navigate (strUrl)
Browser.StatusBar = False
Browser.Toolbar = False
Browser.Visible = True
Browser.Resizable = False
Browser.AddressBar = False

objItem.Save
GoTo Leave

End If

Set objSelection = objApp.ActiveExplorer.Selection

For Each objItem In objSelection

Set Browser = CreateObject("InternetExplorer.Application")
strUrl = objItem.UserProperties("LinkedIn Webpage")
Browser.Navigate (strUrl)
Browser.StatusBar = False
Browser.Toolbar = False
Browser.Visible = True
Browser.Resizable = False
Browser.AddressBar = False

Next

Leave:
Set objItem = Nothing
Set objFolder = Nothing
Set objNS = Nothing
Set objApp = Nothing

End Sub
 

LMS

Senior Member
Outlook version
Email Account
Exchange Server
Can we change my code so it just copies the words from the field? And change the code again so it pastes to the same field of another contact what I copied from the first code?
 

Forum Admin

Senior Member
What do you mean, just copies the words? That is what this does:
strUrl = objItem.UserProperties("LinkedIn Webpage")
Browser.Navigate (strUrl)

If it didn't work before with objItem.UserProperties("LinkedIn Webpage") in navigate, this is the only way.

Does "same field of another contact" mean you want to select several contacts and run the macro to open a bunch of webpages? (FYI, I do something similar with tasks and the urls in the subject field - if you open too many at once, windows and IE become slugs.)
 

LMS

Senior Member
Outlook version
Email Account
Exchange Server
Sorry for not explaining. This is totally different. I need a macro that when I select or open the contact, it copies the words from the field LinkedIn Webpage. And then the next macro that when I select or open the contact, it pastes to the field LinkedIn Webpage what i copied from the other contact
 

Forum Admin

Senior Member
you need to use a global variable - at the top of the page (above the sub name) put something like
dim strField as string

then the first macro sets strfield to equal the field and the second macro uses strfield to set the value in the second contact.
 

LMS

Senior Member
Outlook version
Email Account
Exchange Server
I don't understand re the copy and the paste. Can you please post the exact full codes that does it? And do meen that I select two contacts and then run the code? That would be great!! And please do the full code re the copy and paste as I don't have it as the code I have goes to the webpage, not copy and paste. Thanks very much as I will try what you give me
 

LMS

Senior Member
Outlook version
Email Account
Exchange Server
I found from earlier how we copied an email address....so the following code copies the words of WebPage....but not the new field that is displayed as LinkedIn Webpage....so to begin with, what can we do as the second macro that pastes the words of the WebPage that was copied, to the the other Field named Linked Webpage.....and there is a story about that.....and also, as a second thing, what to change to the first code I am showing so it copies from the field LinkedIn Webpage.

Public Sub CopyWebPage()
Dim oContact As contactItem


Set oContact = ActiveExplorer().Selection.Item(1)
Set DataObj = New MSForms.DataObject
DataObj.SetText oContact.WebPage
DataObj.PutInClipboard
End Sub
 

LMS

Senior Member
Outlook version
Email Account
Exchange Server
Here is the code that copies the words from theLInkedIn Webpage.......so I just need to know how to copy from the WebPage and paste to the LinkedIn Webpage field:

Public Sub CopyLinkedInWebPage2()
Dim oContact As contactItem


Set oContact = ActiveExplorer().Selection.Item(1)
Set DataObj = New MSForms.DataObject
DataObj.SetText oContact.UserProperties("LinkedIn Webpage")
DataObj.PutInClipboard
End Sub
 

LMS

Senior Member
Outlook version
Email Account
Exchange Server
So what it the full code that I just select another contact and it pastes to the field of that contact...and when you show me, let's use the field to paste to: oContact.UserProperties("LinkedIn Webpage")
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
L Outlook 2007 Macro to Contact From a Field Using Outlook 3
C in outlook 2007-Contact Group-One name have 3 mail id-its possible? Using Outlook 3
L Outlook 2007 Contact Form Code Not Working Using Outlook 20
Z Outlook 2007, clicking email addresses fails to open Contact Using Outlook 0
L Outlook 2007 Macro Save Contact Using Outlook 10
L Outlook 2007 Open Folder From a Contact Using Outlook 22
L Outlook 2007 Macro Open Contact Folder Using Outlook 7
Z outlook 2007 - opening a contact from the search results doesn't use the custom form Using Outlook 10
L Outlook 2007 Contact in a Task Using Outlook 15
L Outlook 2007 Macro to Run a Script From a Contact Form Using Outlook 41
L Outlook 2007 Macro to Add Text to a Contact Field Using Outlook 10
L Outlook 2007 Contact Form - Note Fields Using Outlook 25
M suddenly cannot set outlook 2007 contact reminders Using Outlook 2
R Ingest contact PST from exchange 2007 thru client's Outlook via PRF Exchange Server Administration 2
L Opening up Contact from an Email - Outlook 2007 Using Outlook 15
L Outlook 2007 Contact Review Using Outlook 4
C Outlook 2007 Contact Card opens in margin of screen where I can't see it Using Outlook 3
E Double clicking on from email address does no longer open corresponding contact in Outlook 2007 Using Outlook 7
S Upgrade Outlook 2007 to outlook with Buisiness Contact m|Manger BCM (Business Contact Manager) 2
R Outlook 2007 w/ Business Contact Manager compatible w/ Cardscan? BCM (Business Contact Manager) 1
M Business contact manager 2003 on outlook 2007 BCM (Business Contact Manager) 1
J how to add Business Contact Manager to existing Outlook 2007? BCM (Business Contact Manager) 2
M How do I install Outlook 2007 Business Contact Manager on Win7x64 BCM (Business Contact Manager) 1
M 2007 Outlook - no Business Contact Manager BCM (Business Contact Manager) 7
P Setup failed to install Business Contact Manager for Outlook 2007 BCM (Business Contact Manager) 2
C Business Contact Manager and Outlook 2007 "not enough free memory BCM (Business Contact Manager) 5
L outlook 2007 attach multiple journals to same contact Outlook VBA and Custom Forms 2
K Accessing contact's custom properties in a Outlook 2007 form region Outlook VBA and Custom Forms 1
W Transfer Outlook 2016 autocomplete file to Outlook 2007 Using Outlook 1
C Outlook 2007 Removing then adding account restores junk email processing Using Outlook 0
S Outlook 2007 crash linked to gdiplus.dll Using Outlook 0
S Outlook 2007 - Automatic purge fail Using Outlook 0
J outlook 2007 doesn't let me choose which .pst to search Using Outlook 2
D Outlook 2007 vs. Outlook 2010 -- ToDo Bar Using Outlook 0
D Outlook 2007 on 365 Using Outlook.com accounts in Outlook 2
S Macro for other actions - Outlook 2007 Outlook VBA and Custom Forms 23
S Verwendung von Outlook 2007 Using Outlook 0
A Arthur needs help with 2007 Outlook e-mail Using Outlook.com accounts in Outlook 3
M PST import from Outlook 2007 to 2010 - Address Book contacts all in 1 group Using Outlook 4
S outlook 2007 calendar search Using Outlook 6
B Migrate Outlook 2007 to Office 365 Using Outlook 3
X I have met my waterloo trying to resolve embedded graphics problem with outlook 2007 and now 2016 Using Outlook 1
R Outlook 2007 only loads some appointments Using Outlook 0
C Move Outlook 2007 to new PC with Outlook 365 Using Outlook 3
J Outlook 2007 Hide Messages Option not Available Using Outlook 2
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 4
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 0
B Server errors Outlook 2007 Using Outlook 1
S Reboot of frozen windows7 results in changed outlook 2007 settings Using Outlook 1
S Outlook 2007 printing wrong email address at top of page Using Outlook 8

Similar threads

Top