is it possible to create a macro which can be used to create/insert another macro/sub procedure in VBA on the same machine?
suppose, an outlook vba userform with fields like "macroName, To, CC and BCC"
when user load this userform and update these fields, a new macro (sub procedure) wants to be created on the same machine like below
Dim objMsg As MailItem
Dim emilTo As Outlook.Recipient
Dim emilCC As Outlook.Recipient
Dim emailBCC As Outlook.Recipient
Set objItem = Application.ActiveInspector.CurrentItem
Set objMsg = objItem.Forward
Set emilTo = objMsg.Recipients.Add("to.com")
Set emilCC = objMsg.Recipients.Add("cc.com")
Set emilbcc = objMsg.Recipients.Add("bcc.com")
emailTo.Type = olTo
emailcc.Type = olCC
emailbco.Type = olBCC
so if I create let's say a main/standard vba userform (a forwarding macro in above case) to be used by an end user who probably unknown to vba codlings can create a number of forwarding macros with different recipients. further if these new macros can be assigned to customized button programmatically, it would be wonderful.