How do I remove a published form programatically?

J

Judy Voyles

I have a published form that I have distributed to several users and they
have published it in there 'Personal Forms Library'. I am needing to remove
this form from the 'Personal Forms Library' with a script file so that I can
publish another form with the same name but a different message class.

I use the following code to locate the form description object but nothing I
have tried from this point will allow me to remove it.

Set objOL = CreateObject("Outlook.Application")
set olns = objOL.GetNameSpace("MAPI")

Set myfldr = olns.GetDefaultFolder(6)
numitms = myfldr.items.Count
for I = 1 to numitms
set myitem = myfldr.items(I).formdescription
if myitem.messageclass = "IPM.Note.ADS Request" then

?????????????????

end if
next
msgbox "Done"

If anyone has any suggestions....

Thanks
 
J

Judy Voyles

Can I use CDO is VBscript or will I need to use Redemption with my .Net IDE?
 
J

Judy Voyles

I have looked all over in the Redemption object model and for sample code to
try to figure out just exaclty how to access the Forms folders with
Redemption. I have downloaded OutlookSpy and can find the information using
that so I know it must be something accessible. Maybe I'm just not
understanding something. I just don't see anything that references that
'Personal Forms' or any other forms folder. On the Microsoft support site I
found something about a form viewer in MAPI but I can't find anything like
that in Redemption.

Perhaps someone could point me in the right direction?
 
C

Carol Marotta

Hi Judy, I'm trying to do the exact same thing as you, I've been looking
in CDO posts as well - no luck. I'm using redemption and even if I
display the properties using hrgetproplist, the form name isn't in the
list but I can see it when I look in Outlook.

Carol



*** Sent via Developersdex http://www.developersdex.com ***
 
C

Carol Marotta

Hi Sue, it would be great to see a sample for redemption. This is as
far as I've gotten so far:

Dim objStore As Redemption.RDOStore
Dim objSession As Redemption.RDOSession

Set objSession = CreateObject("Redemption.RDOSession")
objSession.Logon
Set objStore = objSession.Stores.DefaultStore

and then I'd like to check the Common Views folder, here it's #1, but
I'd have to loop through & check the name, anyhow when I check the
common folder hidden objects like this:

debug.print objStore.RootFolder.Folders(1).hiddenItems(i).MessageClass

none of the items are the forms designer message type.

Thanks,
Carol

*** Sent via Developersdex http://www.developersdex.com ***
 
C

Carol Marotta

Hi, it's me again. I think the reason why I'm not seeing this form in
Redemption is possibly because it's not published to Personal Folders,
it's published to Outlook Folders. If I publish it to Personal Forms,
then I can see it, no problem using this:

objstore.RootFolder.Folders(1).HiddenItems(4).Fields(&H6800001E)

(it's in folder #1, item #4, this returns the form name)

Is it possible then to retrieve items published to another folder to
delete them?

Thanks!
Carol


*** Sent via Developersdex http://www.developersdex.com ***
 
K

Ken Slovak - [MVP - Outlook]

Don't use an index value to get Common Views, that's not a good way. Once
you get the Store use the property PR_COMMON_VIEWS_ENTRYID (0x35E60102) to
get the EntryID of the Common Views folder and then get the folder the usual
way using RDOSession.GetFolderFromID.

If there are any forms published in the Personal Forms library they would
have a MessageClass of IPM.Microsoft.FolderDesign.FormsDescription and the
PR_MAILBEAT_BOUNCE_SERVER property (0x6800001E) would have the custom form
MessageClass.
 
K

Ken Slovak - [MVP - Outlook]

See my other post. If a form is published to a folder get the folder's
hidden items collection and look for an item with the message class
IPM.Microsoft.FolderDesign.FormsDescription and use
PR_MAILBEAT_BOUNCE_SERVER to get the custom form message class.
 
C

Carol Marotta

Hi Kevin, thanks for your reply.
Don't use an index value to get Common Views, that's not a >good way.

Oh, I know, I was just testing it out to see if I was able to get any
results at all.
If there are any forms published in the Personal Forms >library they would have a MessageClass of
IPM.Microsoft.FolderDesign.FormsDescription and the
PR_MAILBEAT_BOUNCE_SERVER property (0x6800001E) would have >the custom
form MessageClass.

OK, I know for sure that the forms are not published in the Personal
Forms library, they're published to the Calendar folder or something
like that. I didn't develop this app so I can't change it, I'm only
trying to remove any remaining forms if it's uninstalled. Is there a
way to get to the forms if they've been published to another folder?

Thanks again,
Carol

*** Sent via Developersdex http://www.developersdex.com ***
 
K

Ken Slovak - [MVP - Outlook]

It's Ken, not Kevin.

Yes, find what folder the form is published in and use that folder in code
or use a tool like OutlookSpy or MFCMAPI to manually delete the hidden item
representing the published form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top