T
tb2000
I ran over loosing script source changes a few times when working on the new
form, that's what got me into this...
I am trying as part of my working/debugging environment to have a contact
from modified such that I have a tool (in debugging mode only) to store and
deploy the form to all entries in a given folder after I made changes.
The code seemingly works if I keep the form name unchanged, so far so good.
If I change the name however (to have something like a "SaveAs.." I still
have the old MessageClass in the form and I apparently do not have write
access to change this as well.
Is there any way to change the name of the form AND update the form's
message class programatically?
Thanks ahead!
tb
Here's the central code:
Sub cmdNewFolderForm_Click
Dim i
Dim Itm 'As Outlook.ContactItem
Dim ContactItems 'As Outlook.Folders
Dim objForm 'As Outlook.FormDescription
' first export this form to personal archive so we don't loose it
If msgbox("Exporting this form " & FormDescription.Name & " as " &
txtFormName.Value, 1) <> 1 Then Exit Sub
Set objForm = FormDescription
objForm.Name = txtFormName.Value 'might be irrelevant as long as no name
change takes place here
objForm.PublishForm 2
' now set all folder records
if msgbox ("Setting all items in folder " & objFolder.Name & " to " &
txtFormName.Value,1) <> 1 then exit sub
Set ContactItems = objFolder.Items
i=0
For Each Itm In ContactItems
i = i + 1
With Itm ' do it
' msgbox ("now " & i & " " & Itm.FullName)
.MessageClass = "IPM.Contact." & txtFormName.Value
.Save
End With
Next
Item.MessageClass = "IPM.contact." & txtFormName.Value
Item.save
' be careful, may render THIS form gone unless exported previously
End Sub
form, that's what got me into this...
I am trying as part of my working/debugging environment to have a contact
from modified such that I have a tool (in debugging mode only) to store and
deploy the form to all entries in a given folder after I made changes.
The code seemingly works if I keep the form name unchanged, so far so good.
If I change the name however (to have something like a "SaveAs.." I still
have the old MessageClass in the form and I apparently do not have write
access to change this as well.
Is there any way to change the name of the form AND update the form's
message class programatically?
Thanks ahead!
tb
Here's the central code:
Sub cmdNewFolderForm_Click
Dim i
Dim Itm 'As Outlook.ContactItem
Dim ContactItems 'As Outlook.Folders
Dim objForm 'As Outlook.FormDescription
' first export this form to personal archive so we don't loose it
If msgbox("Exporting this form " & FormDescription.Name & " as " &
txtFormName.Value, 1) <> 1 Then Exit Sub
Set objForm = FormDescription
objForm.Name = txtFormName.Value 'might be irrelevant as long as no name
change takes place here
objForm.PublishForm 2
' now set all folder records
if msgbox ("Setting all items in folder " & objFolder.Name & " to " &
txtFormName.Value,1) <> 1 then exit sub
Set ContactItems = objFolder.Items
i=0
For Each Itm In ContactItems
i = i + 1
With Itm ' do it
' msgbox ("now " & i & " " & Itm.FullName)
.MessageClass = "IPM.Contact." & txtFormName.Value
.Save
End With
Next
Item.MessageClass = "IPM.contact." & txtFormName.Value
Item.save
' be careful, may render THIS form gone unless exported previously
End Sub