A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Expected behauvior when modifying properties? Outlook 2003.



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 28th 09, 10:51 AM posted to microsoft.public.outlook.program_vba
Alberto[_2_]
external usenet poster
 
Posts: 28
Default Expected behauvior when modifying properties? Outlook 2003.

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...

  #2  
Old December 28th 09, 11:21 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Expected behauvior when modifying properties? Outlook 2003.



Could you please point out what your question is?

--
Best regards
Michael Bauer - MVP Outlook
Manage and share your categories:
http://www.vboffice.net/product.html?pub=6&lang=en


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...

  #3  
Old December 28th 09, 01:23 PM posted to microsoft.public.outlook.program_vba
Alberto[_2_]
external usenet poster
 
Posts: 28
Default Expected behauvior when modifying properties? Outlook 2003.


There's no a particular question, i wanted just to share it for comments,
thanks.


"Michael Bauer [MVP - Outlook]" wrote:



Could you please point out what your question is?

--
Best regards
Michael Bauer - MVP Outlook
Manage and share your categories:
http://www.vboffice.net/product.html?pub=6&lang=en


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...

.

  #4  
Old December 28th 09, 05:08 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Expected behauvior when modifying properties? Outlook 2003.

Yes, Outlook has an annoying habit of modifying ReceivedTime everytime an
item is saved.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Alberto" wrote in message
...
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...



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Outlook rules not working as expected Dab Outlook - General Queries 10 May 15th 09 11:18 PM
Outlook 2003 opens to Internet Properties - HELP! Terri Outlook - General Queries 4 June 28th 07 05:41 PM
Outlook 2003- named properties v/s user properties ? newToOutlookProgramming Add-ins for Outlook 2 May 18th 07 06:38 PM
Outlook 2003 Calendar Naming/Properties internetsdave Outlook - General Queries 1 February 23rd 07 01:32 PM
Outlook 2003 - Modifying a profile programatically Paul Goldman Outlook - Installation 1 January 30th 06 04:13 PM


All times are GMT +1. The time now is 06:01 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-2025 Outlook Banter.
The comments are property of their posters.