Apply Custom Contacts form to all existing Contacts

OS Version(s)
  1. Windows
Outlook version
Outlook 2021 64 bit
Email Account
IMAP
Operating system::    Windows 10 Pro, 64 b
Outlook version:     2021
Email type or host:    gika1717@gmail.com

Hello.

I made a Custom Contact Form (named it "Contact"), published it nd tried to apply it to all existing Contacts:
  1. First of all I named newly created Contact Form as "Contact"
  2. By right clicking "Contacts" folder in Outlook pane and clicking "Properties..." in opened window "Contacts properties" in opened window "When posting to this folder, use" in the field from drop-down I changed default "IPM.contact" to "Contact" i.e. indicated my Contact Form that I have designed.
Contact properties window.png


And clicked “OK” button
  1. Then selected "inbox" in Outlook pane and afterwards again "Contacts" folder in Outlook pane.
  2. After that when I created a new contact it started to appeared in Custom Contact Form designed by me. But all other contacts (contacts that existed before) when clicked would open in old form (default IPM.contact form)
  3. After that I tried to apply Custom Contact Form (created by me) to existing contacts following these steps:
  4. While on Contacts folder in Outlook pane pressed Alt+F – “Macros” window opened with “ChangeMessageClass”. Then I clicked on “Run” button and “Microsoft Visual Basic for Applications” window opened. In this window, on left pane I choose “ThisOutlookSession” and pasted VBA code that was recommended on this link: Assign a Form to an Item - VBOffice
Code looks like this:

Public Sub ChangeMessageClassForFolderItems()
Dim Items As Outlook.Items
Dim obj As Object
Dim OldClass$
Dim NewClass$
Dim i&

Set Items = Application.ActiveExplorer.CurrentFolder.Items
If Items.Count > 1 Then
OldClass = Items(1).MessageClass
NewClass = InputBox("Change MessageClass property of all items to: " _
, "Change MessageClass", OldClass)
If NewClass = "" Or LCase$(NewClass) = LCase$(OldClass) Then
Exit Sub
End If
For i = 1 To Items.Count
Set obj = Items(i)
obj.MessageClass = NewClass
obj.Save
Next
End If
End Sub

  1. And here is disaster that arrived: say I am on Inbox (in Outlook’s left pane) and when I select “Contacts” folder this alert/window opens:
Custom form cannot be opened.png


  1. After clicking there on “OK” button unusual and absolutely unacceptable/useless view of “Contacts” folder appears like this:
Contacts folder useless view.png


(My normal view for Contacts folder before changes was this:

Contacts folder normal view.png


So you see it has changed drastically.
  1. More than that: now, in newly emerged view when I click on any contact to open this kind of Contact card opens which has absolutely no data in it and therefore is USELESS.
Opened Contact useless card.png


  1. Now, in order to cope somehow with situation I tried several ways:
    1. Tried Online Repair
    2. Uninstalled and Reinstalled Outlook.
But these didn’t help. Was thinking about uninstalling and reinstalling even of Windows but instead a better idea came: I took my outlook.pst file (main/default data file that my Outlook uses) and tried to use it on my friend’s computer who also uses Outlook program. Result was the same and that tells me that there is a problem with this precise file (outlook.pst) and that I have made some drastic damage to it using that VBA code… ☹

So, dear audience: is there anybody who can help with this situation?

Well, written DETAILED guide would be good but if we exchange through e-mail, WhatsApp, or other interface where I could share my screen in order not to make mistakes would be much, much better,

Thanks in advance.

George

Contacts folder view.png


Contacts folder normal view.png
 
Hello.

I made a Custom Contact Form (named it "Contact"), published it nd tried to apply it to all existing Contacts:
  1. First of all I named newly created Contact Form as "Contact"
  2. By right clicking "Contacts" folder in Outlook pane and clicking "Properties..." in opened window "Contacts properties" in opened window "When posting to this folder, use" in the field from drop-down I changed default "IPM.contact" to "Contact" i.e. indicated my Contact Form that I have designed.
View attachment 4146

And clicked “OK” button
  1. Then selected "inbox" in Outlook pane and afterwards again "Contacts" folder in Outlook pane.
  2. After that when I created a new contact it started to appeared in Custom Contact Form designed by me. But all other contacts (contacts that existed before) when clicked would open in old form (default IPM.contact form)
  3. After that I tried to apply Custom Contact Form (created by me) to existing contacts following these steps:
  4. While on Contacts folder in Outlook pane pressed Alt+F – “Macros” window opened with “ChangeMessageClass”. Then I clicked on “Run” button and “Microsoft Visual Basic for Applications” window opened. In this window, on left pane I choose “ThisOutlookSession” and pasted VBA code that was recommended on this link: Assign a Form to an Item - VBOffice
Code looks like this:

Public Sub ChangeMessageClassForFolderItems()
Dim Items As Outlook.Items
Dim obj As Object
Dim OldClass$
Dim NewClass$
Dim i&

Set Items = Application.ActiveExplorer.CurrentFolder.Items
If Items.Count > 1 Then
OldClass = Items(1).MessageClass
NewClass = InputBox("Change MessageClass property of all items to: " _
, "Change MessageClass", OldClass)
If NewClass = "" Or LCase$(NewClass) = LCase$(OldClass) Then
Exit Sub
End If
For i = 1 To Items.Count
Set obj = Items(i)
obj.MessageClass = NewClass
obj.Save
Next
End If
End Sub

  1. And here is disaster that arrived: say I am on Inbox (in Outlook’s left pane) and when I select “Contacts” folder this alert/window opens:
View attachment 4148

  1. After clicking there on “OK” button unusual and absolutely unacceptable/useless view of “Contacts” folder appears like this:
View attachment 4149

(My normal view for Contacts folder before changes was this:

View attachment 4151

So you see it has changed drastically.
  1. More than that: now, in newly emerged view when I click on any contact to open this kind of Contact card opens which has absolutely no data in it and therefore is USELESS.
View attachment 4152

  1. Now, in order to cope somehow with situation I tried several ways:
    1. Tried Online Repair
    2. Uninstalled and Reinstalled Outlook.
But these didn’t help. Was thinking about uninstalling and reinstalling even of Windows but instead a better idea came: I took my outlook.pst file (main/default data file that my Outlook uses) and tried to use it on my friend’s computer who also uses Outlook program. Result was the same and that tells me that there is a problem with this precise file (outlook.pst) and that I have made some drastic damage to it using that VBA code… ☹

So, dear audience: is there anybody who can help with this situation?

Well, written DETAILED guide would be good but if we exchange through e-mail, WhatsApp, or other interface where I could share my screen in order not to make mistakes would be much, much better,

Thanks in advance.

George

View attachment 4147

View attachment 4150
I fund a solution but just couldn't find a way to delete this my post. So please do not lose time responding.
 
Similar threads
Thread starter Title Forum Replies Date
A Apply Selected Emails to outlook rules and Run Rules Using Outlook 5
J Automatically forward email and apply template Outlook VBA and Custom Forms 0
O How to apply view settings on all accounts and folders Using Outlook 7
E Apply customized Business Card for all users Outlook VBA and Custom Forms 0
Diane Poremsky Use Word Macro to Apply Formatting to Email Using Outlook 0
G how can Apply User-defined Field to all Sub Folder and Other Using Outlook 14
Diane Poremsky Apply Outlook Stationery to Replies and Forwards Using Outlook 0
A Can i apply mail rules to inbox sub folders using VBA Outlook VBA and Custom Forms 2
B Apply two rules on one email Using Outlook 2
R Rules - apply to messages > n days old Using Outlook 2
B Unable to apply rule on Exchange server functional account Exchange Server Administration 1
M Apply different views to calendars Using Outlook 0
C Apply Category Color for Appointment Background Color Using Outlook 2
F Apply Follow up flag ONLY to the people cc'd. Using Outlook 1
T Is there a way to apply a macro before a signature is applied in email? Using Outlook 1
L Unable to apply SP1 to Exchange 2010 Exchange Server Administration 5
H Create/Apply auto formatting rules by VB? Outlook VBA and Custom Forms 2
R Apply a category to item in inbox view Outlook VBA and Custom Forms 1
H Outlook 2016 Custom made "Message" column Outlook VBA and Custom Forms 7
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 Add Map It button to Custom Contacts Form in Outlook 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
K Font Sizing in Custom Form Regions for Contacts 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
K can't get custom form to update multiple contacts using VBA Outlook VBA and Custom Forms 3
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

Similar threads

Back
Top