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

How to copy only the changed and new journal items?



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old March 22nd 07, 06:04 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default How to copy only the changed and new journal items?



Michael, you must store the time of your last copying somewhere. Then you
can compare that value with each item's CreationTime and LastModifiedTime
properties.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?...4&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)

Am Wed, 21 Mar 2007 22:12:36 +0100 schrieb MIchael:

Hello
careful Iam beginner ;-))
I copy journaled items from a private to a public journal folder.
Is ist possible to copy only the changed and new items?
How?
Thanks very much for your help
MIchael

Code:

Dim myOlApp
Dim myNamespace
Dim myFolder
Dim myFolder2Parent
Dim myFolder2
Dim myJournalItems
Dim myitem2copy
Dim myCopiedItem

Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myFolder = myNamespace.GetDefaultFolder(olFolderJournal)
Set myFolder2Parent = myNamespace.Folders("Õ¦fentliche Ordner")
Set myFolder2Parent = myFolder2Parent.Folders("Alle Õ¦fentlichen Ordner")
Set myFolder2 = myFolder2Parent.Folders("AS-DA2-Journal")
Set myJournalItems = myFolder.Items

For Each myitem2copy In myJournalItems
If myitem2copy.Sensitivity = 0 Then
Set myCopiedItem = myitem2copy.Copy
myCopiedItem.Move myFolder2
myitem2copy.Delete
End If
Next

 




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
all calendar items suddenly changed to 2 days Dr Byte Outlook - Calandaring 5 July 17th 06 10:04 AM
Cannot copy this folder as it may contain private items carlstev Outlook - General Queries 2 March 9th 06 10:03 PM
View/Print Activities (Journal Items) MPFG-PD Outlook - Using Contacts 2 March 7th 06 05:44 PM
Duplicated items (Calender,tasks,journal, etc) in Outlook 2003 Thane Outlook - Installation 0 February 1st 06 08:23 PM
copy calendar items from Sharepoint to Outlook? Rainman Outlook - Calandaring 0 February 1st 06 03:04 PM


All times are GMT +1. The time now is 02:29 PM.


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.