Results 1 to 1 of 1
2016-02-08, 12:02 #1
- Join Date
- Feb 2016
- Thanked 0 Times in 0 Posts
effecting real time change of contact form
Outlook 2007: I have a custom contact form and would like to be able to open an existing contact, change to default form for the contact item, and re-display it using the custom form.
I have a macro that changes the default form for the item, but I cannot get it to re-display with the custom form without shutting down Outlook and restarting it. I have confirmed that after running the macro, the form type associated with the item is indeed changed to the custom form, but still won't display using the custom form.
Const frmname = "IPM.Contact.BizCntctFrm" ' the custom form If itm.MessageClass <> frmname Then curfrmnam = itm.MessageClass itm.MessageClass = frmname itm.Save contactFullName = itm.fullname itm.Close olSave Set itm = Nothing criteria = "[FullName] = '" & contactFullName & "'" If UserForms.Count > 0 Then For i = 1 To UserForms.Count If UserForms(i).Name = frmname Then Unload UserForms(i) Next i End If Set contactItems = GetItems(GetNS(GetOutlookApp), olFolderContacts) Set filteredContacts = _ contactItems.Restrict(criteria) If filteredContacts.Count <> 1 Then ' possible dupe MsgBox ("Stop to investigate") Stop End If Set itm = filteredContacts.Item(1) itm.Display End If