Making duplicates

M

Maruthi Balmuri

Hi All,

I have an issue with Outlook Custom Form. We are using this custom for
Performance Evaluation.
If you are working in an evaluation form and leave it open to send or reply
to an email, when you
return to the evaluation and save it, it creates two copies of the
evaluation instead of one. Here is
the code.

'----------- SAVING A COPY TO THE EVAL 2003 FOLDER UNDER THE INBOX ________
On Error Resume Next
Item.Subject = LastName&", "&FirstName&" "& MI & " ("&JobTitle&")"
Item.Save
EvalSaveCheck.Value = "Saved"
Set objSavedCopy = Item.Copy
objSavedCopy.Move Eval2003Folder
On Error GoTo 0
Item.Close(1)

Any idea what is the problem. I need this fix ASAP.
Please respond ASAP if you know what causing this problem.

Thanks..Maruthi
 
M

Maruthi Balmuri

Thanks for your reply. Now I know what is the problem but I don't know how
to fix it.
When you leave the Evaluations 2003 folder and hightlight your Inbox folder,
that time
your Inbox is current folder. Right..? With out making Evaluations 2003
folder as an current one,
simply I'm going to the opened evaluation and trying to save it. By the time
I save the
Evalaution, current active folder is Inbox not Evaluations 2003. So
executing twise. Somehow if
my current folder is not equal to Evaluations 2003, programitically I need
to do that.

Do you know what I'm talking about???

Here is the complete code.
----------------------------------------------------------------------------
-------------------------
Function Item_Close()
For Each objCBar in Item.Getinspector.CommandBars
If objCBar.name = "Standard" then
objCBar.visible = True
End If
Next

Dim objSavedCopy
Dim objSentCopy

On Error Resume Next
Set Eval2003Folder =
Application.GetNameSpace("Mapi").GetDefaultFolder(6).Folders("Evaluations
2003")

If EnTransit = True Then
EnTransit = False
Exit Function
End If

If FirstName = "" Then 'closing a blank form
Item.Close(1)
Exit Function
End If

If Not Item.Saved Then
Item.Close(0)
Exit Function
End If

If Application.ActiveExplorer.currentfolder = "Performance Evaluations"
Then
Item.Close(0)
Exit Function
End If

If Application.ActiveExplorer.CurrentFolder = "Evaluations 2003" Then
Item.Close(0)
Exit Function
End If
'----------- SAVING A COPY TO THE EVAL 2003
FOLDER UNDER THE INBOX ________
On Error Resume Next
Item.Subject = LastName&", "&FirstName&" "& MI & "
("&JobTitle&")"
Item.Save
EvalSaveCheck.Value = "Saved"
Set objSavedCopy = Item.Copy
objSavedCopy.Move Eval2003Folder
On Error GoTo 0
Item.Close(1)
----------------------------------------------------------------------------
-----------------------------
Thanks..Maruthi


You might try removing the Item.Close 1 statement. Since the item is already
closing, it would seem redundant and may be causing your code to fire twice.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.slipstick.com/books/jumpstart.htm
 
S

Sue Mosher [MVP]

No, I don't follow. What difference is the active folder supposed to make?
 

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