I found a way to create a code in the Outlook Session as follows and when I run it, it runs the macro of the macro name.
Public Sub runthis()
macroname
End Sub
Then in the Script area of the Contact form, I added the following code and CommandButton6 to the form, and when I click on the CommandButton, it runs the macroname.
Sub CommandButton6_Click
Set myOlApp = CreateObject("Outlook.Application")
myOlApp.runthis
End Sub
Then when I created the same things as second way with runthis1 with a different macroname and a commandbutton 7, when I run the contact from it shows the commandbuttons and the commandbotton7 runs the macro related to the runthis1
But the problem is when I publish this form, and create a new contact from the form, the new contact does not show the commandbutton7 for some reason....
So it seems I found the way to do it, but it is not saving the second commandbutton7 in the contact I create, even though when I click on a new contact to create, both commandbuttons show up, but the commandbutton7 does not save in the contact I create.
Can we fix this?