PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming "The custom form could not be"

Reply

"The custom form could not be"

 
Thread Tools Rate Thread
Old 01-07-2003, 04:04 PM   #1
F. Jesus
Guest
 
Posts: n/a
Default "The custom form could not be"


I am trying to use VBA to move email based on a few rules
(and I want more than I can get from the "rules wizard")
but on some messages I get the following error message
(twice for the same message):

"The custom form could not be opened. Outlook will use an
Outlook form instead"

Here is the VBA code:

Private Sub InternalProcessFolder(TargetFolder)
Dim Item As Object
Dim Msg As String
Dim MsgType As String

For Each Item In TargetFolder.Items
If TypeName(Item) = "MailItem" Then
Msg = GetSenderDomain(Item)
MsgType = TestMessage(Msg)
If MsgType <> "" Then
Item.Move SomeFolder
End If
End If
Next
End Sub

Function "GetSenderDomain" uses the Redemption library to
get the domain part of the sender address.
Function "TestMessage" returns a string based on the
domain.

Using the debugger, the error message pops up on
the "Item.Move" line.

I am using Outlook 2002, and I have the Redemption library
installed.

Any idea?

Thanks.
  Reply With Quote
Old 01-07-2003, 06:46 PM   #2
Patricia Cardoza - [MVP Outlook]
Guest
 
Posts: n/a
Default Re: "The custom form could not be"

Clear your forms cache. Find and delete the file frmcache.dat on your
computer. It is a system file if you're on Windows XP so you'll need to
enable searching of hidden and system files to find it.

--
Patricia Cardoza
Outlook MVP

***Please post all replies to the newsgroups***
"F. Jesus" <fpj_lixo@sapo.pt> wrote in message
news:31e201c33fea$7873d4a0$a601280a@phx.gbl...
> I am trying to use VBA to move email based on a few rules
> (and I want more than I can get from the "rules wizard")
> but on some messages I get the following error message
> (twice for the same message):
>
> "The custom form could not be opened. Outlook will use an
> Outlook form instead"
>
> Here is the VBA code:
>
> Private Sub InternalProcessFolder(TargetFolder)
> Dim Item As Object
> Dim Msg As String
> Dim MsgType As String
>
> For Each Item In TargetFolder.Items
> If TypeName(Item) = "MailItem" Then
> Msg = GetSenderDomain(Item)
> MsgType = TestMessage(Msg)
> If MsgType <> "" Then
> Item.Move SomeFolder
> End If
> End If
> Next
> End Sub
>
> Function "GetSenderDomain" uses the Redemption library to
> get the domain part of the sender address.
> Function "TestMessage" returns a string based on the
> domain.
>
> Using the debugger, the error message pops up on
> the "Item.Move" line.
>
> I am using Outlook 2002, and I have the Redemption library
> installed.
>
> Any idea?
>
> Thanks.



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off