Expected behauvior when modifying properties? Outlook 2003.

  • Thread starter Thread starter Alberto
  • Start date Start date
Status
Not open for further replies.
A

Alberto

Hello, Outlook surprises me every day more or maybe I have a lack on VBA,

please read the next case and tell me if you understand something

Using Outlook 2003 SP3

langauge: German

Sub1()

' Working on MapiFolderA:

Dim myItem, myNewItem as mailItem

Set myItem= MapiFolderA.items("Item Subject")

Set myNewItem= myItem.Copy

myNewItem.subject="MyNewItem Subject"

myNewItem.save

End sub

At this point we have two items in the folder but myNewItem has the current

time as the value for the ReceivedTime property.

If i would'nt have modified MyNeWItem (.save), the ReceivedTime property

would keep its original value, but of course i want to modify the recently

created item.

Trick!!! To copy temporary the item to another folder.

NO, it doesn't work either: !!!!

Sub1()

' Working on MapiFolderA:

Dim myItem, myNewItem, myItem3 as mailItem

Set myItem= MapiFolderA.items("Item Subject")

Set myNewItem= myItem.Copy

Set MapiFolderB = GetFolder("here Path to Folder B")

Set myItem3 = MyNewItem.Move(MapiFolderB)

myItem3.Subject = "MyItem3 Subject"

myItem3.save

End sub

MyItem3 in the folder MapiFolderB has again the current time/date as the

ReceivedTime property :((

SOLUTION: (Not brilliant but at least work)

Modify the item in the new folder trough another Sub()

Sub1()

' Working on MapiFolderA:

Dim myItem, myNewItem as mailItem

Set myItem= MapiFolderA.items("Item Subject")

Set myNewItem= myItem.Copy

Set MapiFolderB = GetFolder("here Path to Folder B")

Set myItem3 = MyNewItem.Move(MapiFolderB)

Call Sub2

End sub

'In Sub2 we can modify all propertys of the item and then move it to

MapifolderA, for example.

Is this behaviour expected??

I've heard that with Redemption or CDO this behaviour is not expected but in

my environment Redemption is not an option.

Thanks in advance...
 
Could you please point out what your question is?

Best regards

Michael Bauer

Am Mon, 28 Dec 2009 02:51:01 -0800 schrieb Alberto:


> Hello, Outlook surprises me every day more or maybe I have a lack on VBA,
> please read the next case and tell me if you understand something

> Using Outlook 2003 SP3
> langauge: German

> Sub1()
> ' Working on MapiFolderA:
> Dim myItem, myNewItem as mailItem

> Set myItem= MapiFolderA.items("Item Subject")
> Set myNewItem= myItem.Copy
> myNewItem.subject="MyNewItem Subject"
> myNewItem.save
> End sub

> At this point we have two items in the folder but myNewItem has the


current
> time as the value for the ReceivedTime property.
> If i would'nt have modified MyNeWItem (.save), the ReceivedTime property
> would keep its original value, but of course i want to modify the recently
> created item.

> Trick!!! To copy temporary the item to another folder.
> NO, it doesn't work either: !!!!

> Sub1()
> ' Working on MapiFolderA:
> Dim myItem, myNewItem, myItem3 as mailItem

> Set myItem= MapiFolderA.items("Item Subject")
> Set myNewItem= myItem.Copy
> Set MapiFolderB = GetFolder("here Path to Folder B")
> Set myItem3 = MyNewItem.Move(MapiFolderB)
> myItem3.Subject = "MyItem3 Subject"
> myItem3.save
> End sub

> MyItem3 in the folder MapiFolderB has again the current time/date as the
> ReceivedTime property :((

> SOLUTION: (Not brilliant but at least work)
> Modify the item in the new folder trough another Sub()

> Sub1()
> ' Working on MapiFolderA:
> Dim myItem, myNewItem as mailItem

> Set myItem= MapiFolderA.items("Item Subject")
> Set myNewItem= myItem.Copy
> Set MapiFolderB = GetFolder("here Path to Folder B")
> Set myItem3 = MyNewItem.Move(MapiFolderB)

> Call Sub2
> End sub

> 'In Sub2 we can modify all propertys of the item and then move it to
> MapifolderA, for example.

> Is this behaviour expected??
> I've heard that with Redemption or CDO this behaviour is not expected but


in
> my environment Redemption is not an option.

> Thanks in advance...
 
There's no a particular question, i wanted just to share it for comments,

thanks.

"Michael Bauer " wrote:



> Could you please point out what your question is?

> > Best regards
> Michael Bauer
>

>

> Am Mon, 28 Dec 2009 02:51:01 -0800 schrieb Alberto:
>
> > Hello, Outlook surprises me every day more or maybe I have a lack on VBA,
> > please read the next case and tell me if you understand something
> > Using Outlook 2003 SP3
> > langauge: German
> > Sub1()
> > ' Working on MapiFolderA:
> > Dim myItem, myNewItem as mailItem
> > Set myItem= MapiFolderA.items("Item Subject")
> > Set myNewItem= myItem.Copy
> > myNewItem.subject="MyNewItem Subject"
> > myNewItem.save
> > End sub
> > At this point we have two items in the folder but myNewItem has the

> current
> > time as the value for the ReceivedTime property.
> > If i would'nt have modified MyNeWItem (.save), the ReceivedTime property
> > would keep its original value, but of course i want to modify the recently
> > created item.
> > Trick!!! To copy temporary the item to another folder.
> > NO, it doesn't work either: !!!!
> > Sub1()
> > ' Working on MapiFolderA:
> > Dim myItem, myNewItem, myItem3 as mailItem
> > Set myItem= MapiFolderA.items("Item Subject")
> > Set myNewItem= myItem.Copy
> > Set MapiFolderB = GetFolder("here Path to Folder B")
> > Set myItem3 = MyNewItem.Move(MapiFolderB)
> > myItem3.Subject = "MyItem3 Subject"
> > myItem3.save
> > End sub
> > MyItem3 in the folder MapiFolderB has again the current time/date as the
> > ReceivedTime property :((
> > SOLUTION: (Not brilliant but at least work)
> > Modify the item in the new folder trough another Sub()
> > Sub1()
> > ' Working on MapiFolderA:
> > Dim myItem, myNewItem as mailItem
> > Set myItem= MapiFolderA.items("Item Subject")
> > Set myNewItem= myItem.Copy
> > Set MapiFolderB = GetFolder("here Path to Folder B")
> > Set myItem3 = MyNewItem.Move(MapiFolderB)
> > Call Sub2
> > End sub
> > 'In Sub2 we can modify all propertys of the item and then move it to
> > MapifolderA, for example.
> > Is this behaviour expected??
> > I've heard that with Redemption or CDO this behaviour is not expected but

> in
> > my environment Redemption is not an option.
> > Thanks in advance...

> .
>
 
Yes, Outlook has an annoying habit of modifying ReceivedTime everytime an

item is saved.

Dmitry Streblechenko (MVP)

-

"Alberto" <Alberto> wrote in message

news:1AC3B101-96CC-42C7-BDAC-0847BE46FA9D@microsoft.com...
> Hello, Outlook surprises me every day more or maybe I have a lack on VBA,
> please read the next case and tell me if you understand something

> Using Outlook 2003 SP3
> langauge: German

> Sub1()
> ' Working on MapiFolderA:
> Dim myItem, myNewItem as mailItem

> Set myItem= MapiFolderA.items("Item Subject")
> Set myNewItem= myItem.Copy
> myNewItem.subject="MyNewItem Subject"
> myNewItem.save
> End sub

> At this point we have two items in the folder but myNewItem has the
> current
> time as the value for the ReceivedTime property.
> If i would'nt have modified MyNeWItem (.save), the ReceivedTime property
> would keep its original value, but of course i want to modify the recently
> created item.

> Trick!!! To copy temporary the item to another folder.
> NO, it doesn't work either: !!!!

> Sub1()
> ' Working on MapiFolderA:
> Dim myItem, myNewItem, myItem3 as mailItem

> Set myItem= MapiFolderA.items("Item Subject")
> Set myNewItem= myItem.Copy
> Set MapiFolderB = GetFolder("here Path to Folder B")
> Set myItem3 = MyNewItem.Move(MapiFolderB)
> myItem3.Subject = "MyItem3 Subject"
> myItem3.save
> End sub

> MyItem3 in the folder MapiFolderB has again the current time/date as the
> ReceivedTime property :((

> SOLUTION: (Not brilliant but at least work)
> Modify the item in the new folder trough another Sub()

> Sub1()
> ' Working on MapiFolderA:
> Dim myItem, myNewItem as mailItem

> Set myItem= MapiFolderA.items("Item Subject")
> Set myNewItem= myItem.Copy
> Set MapiFolderB = GetFolder("here Path to Folder B")
> Set myItem3 = MyNewItem.Move(MapiFolderB)

> Call Sub2
> End sub

> 'In Sub2 we can modify all propertys of the item and then move it to
> MapifolderA, for example.

> Is this behaviour expected??
> I've heard that with Redemption or CDO this behaviour is not expected but
> in
> my environment Redemption is not an option.

> Thanks in advance...
>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
Commodore iTunes sync on a new computer - any issues to be expected? Using Outlook 9
M Breaking lines, expected end of statement Outlook VBA and Custom Forms 1
M Expected behaviour of recurring appointments? Using Outlook 2
J Calendar Search by Category not showing expected results Using Outlook 7
V Sharing Hotmail contacts / groups not working as expected Using Outlook.com accounts in Outlook 1
R Meeting requests and appointments not working as expected Using Outlook 2
FryW Need help modifying a VBA script for in coming emails to auto set custom reminder time Outlook VBA and Custom Forms 0
L Modifying VBA script to delay running macro Outlook VBA and Custom Forms 3
L Need help modifying a VBA script for emails stuck in Outbox Outlook VBA and Custom Forms 6
V Modifying the built in forms with VBA Outlook VBA and Custom Forms 4
I Outlook 2013 Modifying an Outlook calendar Using Outlook.com accounts in Outlook 0
M Modifying BCM Database using Access BCM (Business Contact Manager) 1
M Modifying Macro MoveAgedMail(2) - use categories & "to" as variable Using Outlook 12
B modifying print template for printing out appointment details Using Outlook 2
S Automatically modifying an email Outlook VBA and Custom Forms 3
U Creating or modifying Outlook .Nk2 file in C# Outlook VBA and Custom Forms 1
C Beginner Needs VBA Help in Modifying Code Outlook VBA and Custom Forms 2
J Modifying a Business Contact Manager Report BCM (Business Contact Manager) 1

Similar threads

Back
Top