I added
" Item.Move MyFolder "
but still two Problems:
1. Theres no Date attribute in the moved messages
2. The orginal msg stucks in my "UnsendMsgBox" ?
Am Fri, 25 Aug 2006 10:46:29 +0200 schrieb Thorsten Stadelmann:
What is your solution?
--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
--
www.VBOffice.net --
Moving Problem is solved.
But:
The attribute "Date" in the moved msg is missing ?
I tried
Code:
Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim MyFolder As MAPIFolder
If Item.SentOnBehalfOfName = "Specific_Name" Then
Set MyFolder =
Application.GetNamespace("MAPI").Folders("Postfach -
Specific_Names").Folders("Gesendete Objekte")
Set Item.SaveSentMessageFolder = MyFolder
End If
End Sub
now the send message stucks in MyOutboxFolder ??
Why isnt the mail moving to ANY SendFolder ?
--
Thorstern
Am Thu, 24 Aug 2006 13:39:00 +0200 schrieb Thorsten Stadelmann:
Thorsten, I think we should stick with this group´s language for all
the
people which read the thread and are also interested in a solution.
(If that´s any problem we could switch to ms.public.de.outlook)
Ok, this is what we have:
You are in an Exchange environment. There´s a shared mailbox, and if
one
of
you sends an e-mail via that mailbox then that e-mail should be stored
into
the Sent Items folder of that mailbox, instead of your default
mailbox.
Assuming that you don´t send e-mails while Outlook isn´t running, the
Application_ItemSend event is the best place for your needs. Instead
of
moving a copy of the (unsent) mail you can set the MailItem´s
SaveSentMessageFolder property to the target folder.
That would work just in time, and there´s no need to use any code when
Outlook starts.
The other approach, Application_Startup, could be used if you want all
the
specific sent items to be moved just once a day (i.e. every time
Outlook
starts). In that case you´d need to loop through all sent items again
and
again searching for the specific sender and move that mails.
I´d suggest to use ItemSend.
--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
--
www.VBOffice.net --
Ich versuchs mal auf deutsch ...
Mein Problem ist, das ich ZWEI Postf?er habe.
Sonst w?ir von Add-In-World dieses Tool wunderbar helfen.
wir greifen zu dritt auf ein gemeinsam genutzes Postfach mit eigener
Adresse
zu. Nun m??en wir, das gesendet Mails mit diesem Speziellen Absender
auch in den gesendeten Ordner des gemeinsam genutzen Postfaches
abgelegt
werden.
Dieser Code steht unter "DieseOutlookSitzung"
Teilweise funktiniert dieses Makro bei meinem Kollegen.
Ich m??e nun folgendes erreichen.
Jeden Morgen,
wenn Outlook ge??et wird,
sollen meine gesende Mails, die mit "NAME_DES_GEM_POSTFACH"
versendet
Wurden,
in Ordner X verschoben werden.
Am Wed, 23 Aug 2006 12:52:52 +0200 schrieb Thorsten Stadelmann:
Hm, for me it´s hard to guess what your intention is.
Application_ItemSend will be called by Outlook automatically, you
don´t
need
to do anything.
If you want to start any code (for any reason) when Outlook starts
then
you
must use the Application_Startup event and call your code from
there.
--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
--
www.VBOffice.net --
MB: "Thorsten, Outlook calls the Application_Startup event."
TS: Sry i dont get it. Maybe because of my "Noob-Status"
How calls Outlook the A_S event ? I guessed,
A_S
needs
a
function to
call.
Like this
Code:
Private Sub Application_Startup()
function_to_call
End Sub
Thought of the Loop:
Currently my code moves all mails send by "specific-sender" to
"specfic-folder" as soon the mails are send. Just-in-Time
Looping through "send-items" will moves the mails every mornig I
start
outlook ?
Newsbeitrag
Am Wed, 23 Aug 2006 10:31:54 +0200 schrieb Thorsten Stadelmann:
Thorsten, Outlook calls the Application_Startup event.
You can then loop through the folder´s Items collection and
execute
your
function for each item.
--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
--
www.VBOffice.net --
in use: Outlook 2003
Following Code moves mails from specific sender as a copy to
specific
folder
Code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
Boolean)
Dim makroApplication_StartupobjFolder As MAPIFolder
Dim MyFolder As MAPIFolder
If Item.SentOnBehalfOfName = "specific sender" Then
Set MyFolder =
Application.GetNamespace("MAPI").Folders("Inbox").Folders("Gesendete
Objekte")
Set MailCopy = Item.Copy
MailCopy.Move MyFolder '-- Mail in Ordner verschieben
End If
End Sub
This code should be able to autostart with outlook.
The First time we start outlook the code should be fired an move
all
send
items to specifi folder.
Currently we press "Alt+F11".
Somebody ?
Thx in advance ...