Agent Script to Delete Non MS-Word Doc Posts to Public Folder

Agent Script to Delete Non MS-Word Doc Posts to Public Folder

Post by dthompso » Sun, 02 Mar 2003 11:06:24



Hello,

I want to have a Folder automatically delete any posts to
it that are not Microsoft Word documents.

So far, what I've done is have the following in an Agent
Script,

Public Sub Folder_OnMessageCreated
        Dim CDOSession, oMsgTarget
        Set CDOSession = EventDetails.Session
        Set oMsgTarget = CDOSession.GetMessage
(EventDetails.MessageID, Null)

        ' if oMsgTarget.Type <> "Microsoft Word" then
                oMsgTarget.Delete
        ' end if
End Sub

This is supposed to delete the message (which it doesn't).

I have commented out the lines I want to put in with the
logic to say, if this isn't a Microsoft Word document,
then delete it from the folder.

How can this be done?  How can the type of post be checked?

Also, on a more general note, is it possible to allow
Files of other types besides Office documents to be posted
to a Public Folder?

Thanks!

 
 
 

Agent Script to Delete Non MS-Word Doc Posts to Public Folder

Post by Siegfried Weber [MVP » Tue, 04 Mar 2003 22:25:40


See my reply in the other newsgroup (which I do not remember, sorry) to you.

--
<Cheers:Siegfried runat="server" />

Development Lead,

CDOLive LLC - The Microsoft Messaging and Collaboration Application Experts
http://www.cdolive.com


Quote:> Hello,

> I want to have a Folder automatically delete any posts to
> it that are not Microsoft Word documents.

> So far, what I've done is have the following in an Agent
> Script,

> Public Sub Folder_OnMessageCreated
> Dim CDOSession, oMsgTarget
> Set CDOSession = EventDetails.Session
> Set oMsgTarget = CDOSession.GetMessage
> (EventDetails.MessageID, Null)

> ' if oMsgTarget.Type <> "Microsoft Word" then
> oMsgTarget.Delete
> ' end if
> End Sub

> This is supposed to delete the message (which it doesn't).

> I have commented out the lines I want to put in with the
> logic to say, if this isn't a Microsoft Word document,
> then delete it from the folder.

> How can this be done?  How can the type of post be checked?

> Also, on a more general note, is it possible to allow
> Files of other types besides Office documents to be posted
> to a Public Folder?

> Thanks!


 
 
 

Agent Script to Delete Non MS-Word Doc Posts to Public Folder

Post by dt » Wed, 05 Mar 2003 07:46:45


Yes, I've been following that post on Event Sink Cannot
Delete attachments but I still can't get it to work.

You had said something about updating the code that exists
at CDOLIVE.com or something.

Could you send me the update or tel me when it's available
so i can try to get this to work.

I don't need to save attachments -- just now allow a
posting of any type except Word Document, but it never
deletes it!

if InStr(oMsgTarget.Type,1, "IPM.Document.Word.Document")
= 0 then
  oMsgTarget.Delete
end if

- Robert

Quote:>-----Original Message-----
>See my reply in the other newsgroup (which I do not

remember, sorry) to you.

>--
><Cheers:Siegfried runat="server" />

>Development Lead,

>CDOLive LLC - The Microsoft Messaging and Collaboration
Application Experts
>http://www.cdolive.com


message

>> Hello,

>> I want to have a Folder automatically delete any posts
to
>> it that are not Microsoft Word documents.

>> So far, what I've done is have the following in an Agent
>> Script,

>> Public Sub Folder_OnMessageCreated
>> Dim CDOSession, oMsgTarget
>> Set CDOSession = EventDetails.Session
>> Set oMsgTarget = CDOSession.GetMessage
>> (EventDetails.MessageID, Null)

>> ' if oMsgTarget.Type <> "Microsoft Word" then
>> oMsgTarget.Delete
>> ' end if
>> End Sub

>> This is supposed to delete the message (which it
doesn't).

>> I have commented out the lines I want to put in with the
>> logic to say, if this isn't a Microsoft Word document,
>> then delete it from the folder.

>> How can this be done?  How can the type of post be
checked?

>> Also, on a more general note, is it possible to allow
>> Files of other types besides Office documents to be
posted
>> to a Public Folder?

>> Thanks!

>.

 
 
 

Agent Script to Delete Non MS-Word Doc Posts to Public Folder

Post by Siegfried Weber [MVP » Wed, 05 Mar 2003 22:44:04



> Yes, I've been following that post on Event Sink Cannot
> Delete attachments but I still can't get it to work.

Thats weired. What do you get if you use a tool like OutlookSpy
(www.dimastr.com) to check the message class of a Word document posted to a
public folder? IIRC it is what I mentioned in my previous reply.

Quote:> You had said something about updating the code that exists
> at CDOLIVE.com or something.

Where? Which code? What discussion thread are you refering to? I am
confused...

Quote:> if InStr(oMsgTarget.Type,1, "IPM.Document.Word.Document")
> = 0 then
>   oMsgTarget.Delete
> end if

I still believe that the above code works.

--
<Cheers:Siegfried runat="server" />

Development Lead,

CDOLive LLC - The Microsoft Messaging and Collaboration Application Experts
http://www.cdolive.com

 
 
 

1. Public Folder auto-delete non MS-Word posts

Hello,

I want to have a Public Folder automatically delete any
posts to it that are not Microsoft Word documents.

So far, what I've done is have the following in an Agent
Script,

Public Sub Folder_OnMessageCreated
        Dim CDOSession, oMsgTarget
        Set CDOSession = EventDetails.Session
        Set oMsgTarget = CDOSession.GetMessage
(EventDetails.MessageID, Null)

        ' if oMsgTarget.Type <> "Microsoft Word" then
                oMsgTarget.Delete
        ' end if
End Sub

This is supposed to delete the message (which it doesn't).

I have commented out the lines I want to put in with the
logic to say, if this isn't a Microsoft Word document,
then delete it from the folder.

How can this be done?  How can the type of post be checked?

Also, on a more general note, is it possible to allow
Files of other types besides Office documents to be posted
to a Public Folder?

Thanks!
.

2. Resource Scheduling (Permissions Problem) How do I enable the automatic acceptance of meetings?

3. Public Folders allowing only MS-Word (agent script)

4. some outlook 2000 users complain that e-mail is slow

5. Using CDO to view Public Folders Word Doc items

6. PARIS Vacation for FREE?

7. Word 97 Doc to Public Folder

8. SMTP Relay & Internet headers

9. Post Word Doc to Public Folder

10. word doc in public folder

11. Multiple users accessing word doc in public folder

12. Exchange Server Scripting - open word doc

13. Q: Deleted users and the effect on their posts in Public Folders