Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   Clone mailitem (http://www.outlookbanter.com/add-ins-outlook/89608-clone-mailitem.html)

Ramazan April 28th 09 08:52 AM

Clone mailitem
 
Hi all,
I want to clone mail item. When i use Copy() method for mailitem in
inbox folder and call Display() method there is a Send button. But it
must be reply,forward and reply all buttons. I think Copy() method
copies some of properties like Subject,To,Body...

How can i clone with all properties?
Thanks in advance.
Ramazan

Ken Slovak - [MVP - Outlook] April 28th 09 02:22 PM

Clone mailitem
 
Copy() should copy just about all the properties from an original item. Of
course things like EntryID will be different. If there are any properties
you don't see on the copy from the original then you must copy them over
yourself.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Ramazan" wrote in message
...
Hi all,
I want to clone mail item. When i use Copy() method for mailitem in
inbox folder and call Display() method there is a Send button. But it
must be reply,forward and reply all buttons. I think Copy() method
copies some of properties like Subject,To,Body...

How can i clone with all properties?
Thanks in advance.
Ramazan



Ramazan April 29th 09 07:38 AM

Clone mailitem
 
On Apr 28, 4:22 pm, "Ken Slovak - [MVP - Outlook]"
wrote:
Copy() should copy just about all the properties from an original item. Of
course things like EntryID will be different. If there are any properties
you don't see on the copy from the original then you must copy them over
yourself.

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.http://www.slovaktech.com/products.htm

"Ramazan" wrote in message

...

Hi all,
I want to clone mail item. When i use Copy() method for mailitem in
inbox folder and call Display() method there is a Send button. But it
must be reply,forward and reply all buttons. I think Copy() method
copies some of properties like Subject,To,Body...


How can i clone with all properties?
Thanks in advance.
Ramazan



I understand this, It is not related to copy. I call Copy() method
and contruct new mail and call Display() method . I can't see
Reply,forward and reply all buttons. It says that "Message is not
send". I can onlu show Send button.
But when i double click on new constructed mail and open it, on
inspector i can see Reply,forward and reply all buttons.
I can't understand where is the problem .
I will try call in thread mailitem display method after wait a 1-2
minute. Because i'm doing all of this activities in OnOpen() method. I
will try after return OnOpen()
Do you have any idea?

Ken Slovak - [MVP - Outlook] April 29th 09 02:42 PM

Clone mailitem
 
Well obviously if you create a new, unsent message it will be unsent and
won't have the Reply, ReplyAll or Forward buttons. No new mail does.

I don't care if you double-click to open a new item or not, if it was never
sent it shouldn't have those buttons. If you are seeing something else then
you aren't explaining what you actually are seeing, or your Outlook is
really messed up.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Ramazan" wrote in message
...
snip
I understand this, It is not related to copy. I call Copy() method
and contruct new mail and call Display() method . I can't see
Reply,forward and reply all buttons. It says that "Message is not
send". I can onlu show Send button.
But when i double click on new constructed mail and open it, on
inspector i can see Reply,forward and reply all buttons.
I can't understand where is the problem .
I will try call in thread mailitem display method after wait a 1-2
minute. Because i'm doing all of this activities in OnOpen() method. I
will try after return OnOpen()
Do you have any idea?



ds2k7 May 13th 09 06:22 AM

Clone mailitem
 
I'm having a similar issue, though not with the Clone function. I'm starting
to think it's just the way Display works

My situation is as follows:

emails arrive in the inbox, and must be relocated to another folder
("Cabinet") as they are read. Since outlook has the tendancy to close the
email when moving it to another folder, I have written the following to
relocate the email, and then display it again:


Set objApp = Outlook.Application
Set objNS = Outlook.Application.GetNamespace("MAPI")
Set objItem = GetCurrentItem() 'some other working function
Set objFolder = objItem.Parent
Set MAPIFolderObject = objFolder.Parent
Set objFolder1 = MAPIFolderObject.Folders("Cabinet")
Set movedItem = objItem.Move(objFolder1)
movedItem.Display

now, when the email is originally opened, it is shown in read mode. From: is
the sender's address, to: is my group's address, etc.

After running the macro, the mail is redisplayed in edit mode, from: is the
sender's address, to: is my group's address. Only the Send button is
available, yet I would expect to be able to Reply.

Since I'm faily sure that's what this thread was getting at, any idea of
cause/resolution?


"Ken Slovak - [MVP - Outlook]" wrote:

Well obviously if you create a new, unsent message it will be unsent and
won't have the Reply, ReplyAll or Forward buttons. No new mail does.

I don't care if you double-click to open a new item or not, if it was never
sent it shouldn't have those buttons. If you are seeing something else then
you aren't explaining what you actually are seeing, or your Outlook is
really messed up.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Ramazan" wrote in message
...
snip
I understand this, It is not related to copy. I call Copy() method
and contruct new mail and call Display() method . I can't see
Reply,forward and reply all buttons. It says that "Message is not
send". I can onlu show Send button.
But when i double click on new constructed mail and open it, on
inspector i can see Reply,forward and reply all buttons.
I can't understand where is the problem .
I will try call in thread mailitem display method after wait a 1-2
minute. Because i'm doing all of this activities in OnOpen() method. I
will try after return OnOpen()
Do you have any idea?




Ken Slovak - [MVP - Outlook] May 13th 09 02:59 PM

Clone mailitem
 
This is not the same thing as what this thread is discussing, please do not
hijack threads, start your own.

When an item is moved it's first copied to the new folder and then the
original item is deleted.

If your code gets the EntryID of movedItem and then closes and releases all
instances of your Inspector/MailItem objects and then uses the EntryID to
get the moved item as a new instance of a MailItem object you will not see
what you are seeing now. To release the existing instances set them to
Nothing.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"ds2k7" wrote in message
...
I'm having a similar issue, though not with the Clone function. I'm
starting
to think it's just the way Display works

My situation is as follows:

emails arrive in the inbox, and must be relocated to another folder
("Cabinet") as they are read. Since outlook has the tendancy to close the
email when moving it to another folder, I have written the following to
relocate the email, and then display it again:


Set objApp = Outlook.Application
Set objNS = Outlook.Application.GetNamespace("MAPI")
Set objItem = GetCurrentItem() 'some other working function
Set objFolder = objItem.Parent
Set MAPIFolderObject = objFolder.Parent
Set objFolder1 = MAPIFolderObject.Folders("Cabinet")
Set movedItem = objItem.Move(objFolder1)
movedItem.Display

now, when the email is originally opened, it is shown in read mode. From:
is
the sender's address, to: is my group's address, etc.

After running the macro, the mail is redisplayed in edit mode, from: is
the
sender's address, to: is my group's address. Only the Send button is
available, yet I would expect to be able to Reply.

Since I'm faily sure that's what this thread was getting at, any idea of
cause/resolution?




All times are GMT +1. The time now is 10:36 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com