none
Outlook 2007 Contact Form Two Pages RRS feed

  • Question

  • I have a new contact form that has the normal fields in it, including the webpage for the contact.  Is there a way to add a new field to the contact form that is another webpage and does not simply be the same webpage from the first webpage field?

    Friday, June 6, 2014 10:44 PM

Answers

  • Hi Imseaz,

    >>so I want to do, is make this happen between two contacts I select...so it comes from the email1address from one contact to the email1address of he second contact selected at the same time<<

    The item in selection object is readonly, we couldn't change its field. We need to display id for modifing, here is a sample for copy the first contact's mail address to the second one:

    Sub CopyAddress()
    
    Application.ActiveExplorer.Selection.Item(2).Display
    Application.ActiveExplorer.Selection.Item(2).Email1Address = Application.ActiveExplorer.Selection.Item(1).Email1Address
    Application.ActiveExplorer.Selection.Item(2).Close OlInspectorClose.olSave
    
    End Sub

    Note: before runing the code, you need to choose two contacts.

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, June 20, 2014 8:56 AM
    Moderator

All replies

  • 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

    Saturday, June 7, 2014 12:10 AM
  • To All,

    I found the way to do this and it can be helpful since I cannot find anyway to add  hyperlink field to a contact form.  And it works if I select a contact or open a 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

     

     

     

    Saturday, June 7, 2014 4:40 AM
  • Hello Imseaz,

    Glad to hear that you have the required code.

    It looks like you were interested in creating a custom inspector form. The Tutorial: Creating and distributing custom forms with Outlook article describes the required steps in depth. Also you may consider using an Outlook form region - see the Creating Outlook Form Regions section in MSDN.

    Saturday, June 7, 2014 10:35 AM
  • Is there a way to change so it does not run the webpage, it just copies the words from the standard webpage field in the contact?
    Saturday, June 7, 2014 7:19 PM
  • Sorry, but I don't quite understand you. I'd recommend taking screenshots in addition to your description.
    Saturday, June 7, 2014 7:32 PM
  • I need a code that copies the words from a specific field of a contact I select or open.   So if the field I want the words from is the objItem.UserProperties("LinkedIn Webpage"), is here a code that simply copies the words from that field when I select or open the contact?
    Saturday, June 7, 2014 7:36 PM
  • I have two different fields in my contact form and need a code that copies from the Webpage field, and pastes to the LinkedIn Webpage  field of the second selected contact....

    Here are the codes that can copy from each field, so is there a way to put this togeter so it copies the Webfield of the the first contact selected, and then pastes to the additional contact selected at the same time.

    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

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


    • Edited by lmseaz Sunday, June 8, 2014 5:52 AM
    Sunday, June 8, 2014 5:50 AM
  • Hello Imseaz,

    There is no trivial way for implementing the required functionality due to the fact that the Outlook Social Connector add-in doesn't provide any public API. However, you can try using Accessibility API as a workaround or just develop or your own provider. Read more about this in the Outlook Social Connector Provider Interfaces article in MSDN.

    Sunday, June 8, 2014 12:40 PM
  • Did you mean you want to copy the field of webpage which opened by the code below:

     Set
    Browser = CreateObject("InternetExplorer.Application")
    
     strUrl = objItem.UserProperties("LinkedIn Webpage")
    
     Browser.Navigate (strUrl)

    If yes, you can use getElementById method to find the specific element and get the text of the element by innerTextproperty.

    If I misunderstood, please feel free to let me know.

    Best regards

    Fei



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, June 9, 2014 10:13 AM
    Moderator
  • Here is the code that copies the words from the field of the contact I select.....so what can we change so it pastes to that field what I had copied from some other contact.....here it the copy code...and just want to change so it pastes to the field of the contact...

    '


    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

    Monday, June 9, 2014 2:21 PM
  • This is the code that movest the email1address to the email2address in the same contact.....so I want to do, is make this happen between two contacts I select...so it comes from the email1address from one contact to the email1address of he second contact selected at the same time.

    Public Sub ConvertEmail1toEmail2()
        Dim currentExplorer As Explorer
        Dim Selection As Selection
        Dim obj As Object
       
        Set currentExplorer = Application.ActiveExplorer
        Set Selection = currentExplorer.Selection
     
        On Error Resume Next
     
        For Each obj In Selection
           
                Set objContact = obj
     
         With objContact
               If .Email1Address <> "" Then
               Let .Email2Address = .Email1Address
               .Email1Address = ""
               .Save
              End If
         End With
          
     
         Err.Clear
        Next
     
     
        Set obj = Nothing
        Set objContact = Nothing
       
        End Sub
    Tuesday, June 10, 2014 2:32 AM
  • Hi Imseaz,

    >>so I want to do, is make this happen between two contacts I select...so it comes from the email1address from one contact to the email1address of he second contact selected at the same time<<

    The item in selection object is readonly, we couldn't change its field. We need to display id for modifing, here is a sample for copy the first contact's mail address to the second one:

    Sub CopyAddress()
    
    Application.ActiveExplorer.Selection.Item(2).Display
    Application.ActiveExplorer.Selection.Item(2).Email1Address = Application.ActiveExplorer.Selection.Item(1).Email1Address
    Application.ActiveExplorer.Selection.Item(2).Close OlInspectorClose.olSave
    
    End Sub

    Note: before runing the code, you need to choose two contacts.

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, June 20, 2014 8:56 AM
    Moderator