I am creating a small application to allow remote users to publish forms to their personal form library but would like to update or remove (and then add) forms with the same name. Currently the code I have will install mutiple forms of the same name in their Personal Form Library. Can anyone help me with the code to REMOVE a form from the library?? I am automating Outlook from a VB 6.0 program.
Dim filename As String
Dim Temp As String
Dim endpos As Integer
Dim mylength As Integer
Set myOlApp = GetObject("", "Outlook.Application")
' retrieve Outlook Templates
filename = Dir$("c:\temp\formsdata\*.oft", vbNormal)
Do Until filename = ""
mylength = Len(filename)
' strip off the extension from the filename. This will be the name of the form.
endpos = InStr(1, filename, ".oft", 1)
strTemp = Trim(Mid(filename, 1, endpos - 1))
' publish all Outlook forms into the Personal Registry
Set myItem = myOlApp.createitemfromtemplate("C:\temp\formsdata\" & filename)
Set myform = myItem.formdescription
myform.Name = strTemp
'Remove old form code here
filename = Dir$