Delete obsolete icons from workspace using LotusScript

I used the following code to delete obsolete icons from the workspace. The obsolete icons are caused by server migration. It will delete OK if the icon exists even if the icon is obsolete. However, if the icon does not exist, the AddDatabase line will generate an error msg popup saying “Server Error: File does not exist”. My question is: is there a way to suppress this error msg popup? I want it to behave like nothing happens if the icon does not exist in the workspace.

I posted this before, but I don’t think I made myself clear.

Thanks.

On Error Resume Next

'set focus on the icon

Call ws.AddDatabase(“Server”,“DBName”)

If Err >10 Then

Else 'set focus is OK

keybd_event &h2e,0,0,0 ’ Del key down

keybd_event &h2e,0,2,0 ’ Del key up

keybd_event &h0D,0,0,0 ’ Y key down

keybd_event &h0D,0,2,0 ’ Y key up

End If

Subject: Delete obsolete icons from workspace using LotusScript

Would you be willing to share your code? A long time ago, we had our Helpdesk software on a server and had a survey link on the users workspace. We recently moved our Helpdesk software to a different server and the survey link moved, but the old link is still on our users workspace. So now our users can’t use the survey link because the DB isn’t there anymore.

Thanks in advance,

hankejp@gmail.com

Subject: RE: Delete obsolete icons from workspace using LotusScript

The code is in the post (the weird looking part of the code actually deletes the icon). The problem is, it will popup a error message if the the obsolete icon does not exist.

Subject: RE: Delete obsolete icons from workspace using LotusScript

Plus this declaration:

Declare Sub keybd_event Lib “user32.dll” (Byval bVk As Integer, Byval bScan As Integer, Byval dwFlags As Integer,Byval dwExtraInfo As Integer)

Subject: Try setting and trapping a set for a db object

Perhpas, before you call your “AddDatabase”, check for the existance of the database by trying to set a db.

I suspect that the AddDatabase method is displaying the popup before returning to the LS code so it still shows.

If you set the db object and there is an error, I don’t think the system will pop-up a message.