Announcement

Collapse
No announcement yet.

Exchange Web Services Managed API

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exchange Web Services Managed API

    I have custom forms with some VBA or VB or Macro in them that do not work now that I've migrated from a local SBS2003 server to Hosted exchange 2010. Please forgive me, I am not a programmer but I suspect it's something to do with "Exchange Web Services Managed API", but I don't know how to modify the code to make it work.

    I'm hopeful I can do this myself with some guidance, but I may need to hire a programmer.

    Here is my code, any help is appreaciated.

    Specifically, the...

    Sub chkAccountSameAs1_Click

    is the main area that is not working.



    dim ComposeMode
    dim oDefaultPage
    dim oNameSpace
    dim oCurrentFolder
    dim NewContactCreated
    ComposeMode = True
    NewContactCreated = False
    Sub Item_Open
    set oDefaultPage = GetInspector.ModifiedFormPages("Application")
    set oNameSpace = Application.GetNameSpace("MAPI")
    set oCurrentFolder = Application.ActiveExplorer.CurrentFolder
    End Sub
    Sub Item_Read
    ComposeMode = False
    End Sub
    Sub Item_CustomPropertyChange(ByVal Name)
    Const olContactItem = 2
    dim objPhoneFld
    dim objTempContact
    dim txtFieldName
    dim blnPhoneNumber
    blnPhoneNumber = False
    Select Case Name
    Case "Owner1Evening"
    txtFieldName = "Owner1Evening"
    blnPhoneNumber = True
    Case "Owner1Daytime"
    txtFieldName = "Owner1Daytime"
    blnPhoneNumber = True
    Case "Owner2Evening"
    txtFieldName = "Owner2Evening"
    blnPhoneNumber = True
    Case "Owner2Daytime"
    txtFieldName = "Owner2Daytime"
    blnPhoneNumber = True
    Case "Owner3Evening"
    txtFieldName = "Owner3Evening"
    blnPhoneNumber = True
    Case "Owner3Daytime"
    txtFieldName = "Owner3Daytime"
    blnPhoneNumber = True
    End Select
    If blnPhoneNumber = True Then
    set objPhoneFld = Item.UserProperties(txtFieldName)
    set objTempContact = Application.CreateItem(olContactItem)
    objTempContact.BusinessTelephoneNumber = objPhoneFld.Value
    objPhoneFld.Value = objTempContact.BusinessTelephoneNumber
    objTempContact.Delete
    End If
    End Sub
    Sub cmdStartMailMerge_Click
    Set oWord = Item.Application.CreateObject("Word.Application")
    oWord.Visible = True

    End Sub


    Sub SameAsMailing(ByVal Number,ByVal Number2)
    set oPage = oDefaultPage.Controls("MultiPage1").Pages(Number - 1 )

    UserProperties("Owner" & Number & "Legal1") = UserProperties("Owner" & Number & "Address1")
    UserProperties("Owner" & Number & "Legal2") = UserProperties("Owner" & Number & "Address2")
    UserProperties("Owner" & Number & "LegalCity") = UserProperties("Owner" & Number & "City")
    UserProperties("Owner" & Number & "LegalState") = UserProperties("Owner" & Number & "State")
    UserProperties("Owner" & Number & "LegalZip") = UserProperties("Owner" & Number & "Zip")
    oPage.Controls(Number2).SetFocus
    End Sub
    Sub SameAsOwner1(ByVal Number, ByVal Number2)
    set oPage = oDefaultPage.Controls("MultiPage1").Pages(Number -1)

    UserProperties("Owner" & Number & "Address1") = UserProperties("Owner1Address1")
    UserProperties("Owner" & Number & "Address2") = UserProperties("Owner1Address2")
    UserProperties("Owner" & Number & "City") = UserProperties("Owner1City")
    UserProperties("Owner" & Number & "State") = UserProperties("Owner1State")
    UserProperties("Owner" & Number & "Zip") = UserProperties("Owner1Zip")
    UserProperties("Owner" & Number & "Evening") = UserProperties("Owner1Evening")
    UserProperties("Owner" & Number & "Daytime") = UserProperties("Owner1Daytime")
    oPage.Controls(Number2).SetFocus
    End Sub
    Sub NextPage(ByVal Number)
    'Changes active page in multipage control to next tab and sets focus
    oDefaultPage.Controls("MultiPage1").Value = Number -1
    set oPage = oDefaultPage.Controls("MultiPage1").Pages(Number-1)
    oPage.Controls(0).SetFocus
    End Sub
    Sub Done
    'Moves focus to account info outside of multipage control
    oDefaultPage.Controls("MultiPage1").Value = 0
    oDefaultPage.Controls("chkAccountSameAs1").SetFocu s
    End Sub

    Sub cmdOwner1Next_Click
    NextPage(2) 'Go to Page 2
    End Sub
    Sub cmdOwner2Next_Click
    NextPage(3) 'Go tp Page 3
    End Sub
    Sub cmdOwner1Done_Click
    Done()
    End Sub
    Sub cmdOwner2Done_Click
    Done()
    End Sub
    Sub cmdOwner3Done_Click
    Done()
    End Sub
    Sub chkOwner1SameAs_Click
    SameAsMailing 1,13
    End Sub
    Sub chkOwner2SameAs_Click
    SameAsMailing 2,28
    End Sub
    Sub chkOwner3SameAs_Click
    SameAsMailing 3,28
    End Sub
    Sub chkOwner2SameAs1_Click
    SameAsOwner1 2,34
    End Sub
    Sub chkOwner3SameAs1_Click
    SameAsOwner1 3,34
    End Sub
    Sub chkAccountSameAs1_Click
    UserProperties("AccountAddress1") = UserProperties("Owner1Address1")
    UserProperties("AccountAddress2") = UserProperties("Owner1Address2")
    serProperties("AccountCity") = UserProperties("Owner1City")
    UserProperties("AccountState") = UserProperties("Owner1State")
    UserProperties("AccountZip") = UserProperties("Owner1Zip")
    UserProperties("AccountEvening") = UserProperties("Owner1Evening")
    UserProperties("AccountDaytime") = UserProperties("Owner1Daytime")
    oDefaultPage.Controls("AnnualIncome").SetFocus
    End Sub
    Sub cmdSaveAndNew_Click
    Item.Save
    set oNameSpace = Application.GetNameSpace("MAPI")
    set NFSFolder = oNameSpace.Folders("NFS Clients")
    msgbox(NFSFolder)
    set NewClient = NFSFolder.Items.Add("IPM.Contact.NFS Clients")
    NewClient.Display
    Item.Close 2

    End Sub


    Sub Display_Indices
    set oPage1 = oDefaultPage.Controls("MultiPage1").Pages(0)
    set oPage2 = oDefaultPage.Controls("MultiPage1").Pages(1)
    set oPage3 = oDefaultPage.Controls("MultiPage1").Pages(2)

    for i = 0 to oPage2.Controls.Count -1
    txtText = txtText & Chr(13) & i & " = " & oPage2.Controls(i).Name
    next
    msgbox (txtText)
    End Sub
Working...
X