"Autostart": Application_Start

  • Thread starter Thorsten Stadelmann
  • Start date
T

Thorsten Stadelmann

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

Michael Bauer [MVP - Outlook]

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

Thorsten Stadelmann

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 ?




Michael Bauer said:
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 ...
 
M

Michael Bauer [MVP - Outlook]

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 ?




Michael Bauer said:
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 ...
 
T

Thorsten Stadelmann

Ich versuchs mal auf deutsch ...

Mein Problem ist, das ich ZWEI Postfächer habe.
Sonst würde mir von Add-In-World dieses Tool wunderbar helfen.

wir greifen zu dritt auf ein gemeinsam genutzes Postfach mit eigener Adresse
zu. Nun möchten 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öchte nun folgendes erreichen.

Jeden Morgen,
wenn Outlook geöffnet wird,

sollen meine gesende Mails, die mit "NAME_DES_GEM_POSTFACH" versendet
Wurden,

in Ordner X verschoben werden.


Michael Bauer said:
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 ?




Michael Bauer said:
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 ...
 
M

Michael Bauer [MVP - Outlook]

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.


Michael Bauer said:
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 ?




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

Thorsten Stadelmann

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





Michael Bauer said:
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.


Michael Bauer said:
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 ?




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

Thorsten Stadelmann

Moving Problem is solved.
But:

The attribute "Date" in the moved msg is missing ?


Thorsten Stadelmann said:
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





Michael Bauer said:
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 ?




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

Michael Bauer [MVP - Outlook]

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 ?


Thorsten Stadelmann said:
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





Michael Bauer said:
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 ?




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

Thorsten Stadelmann

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" ?


Michael Bauer said:
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 ?


Thorsten Stadelmann said:
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 ?




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

Michael Bauer [MVP - Outlook]

Am Fri, 25 Aug 2006 12:38:41 +0200 schrieb Thorsten Stadelmann:

ItemSend is fired *before* the message is actually sent. That doesn´t work.
Simply set the mentioned property, that should do it.

What is an "UnsendMsgBox", do you mean the Outbox (Postausgang)? Does that
also happen if you do not move the message but only set the
SaveSentMessageFolder property? If so, please check such an item in the
Outbox: is the font italic or not?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

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" ?


Michael Bauer said:
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 ?




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

Thorsten Stadelmann

Hi again,

my code is runnin fine now.

I use:
Code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim MyFolder As MAPIFolder
Set MyFolder = Application.GetNamespace("MAPI").Folders("Postfach -
special-sender").Folders("Gesendete Objekte")

If Item.SentOnBehalfOfName = "special-sender" Then
Item.Move MyFolder

End If
End Sub

to move messages from a special sender to a echange send folder.

But still got one small Problem.

The moved messages got no informations like Date of send.
It would be nice to have the information to do a sort.

An suggestions to set the date of the moved msg ?

--
Thorsten


Michael Bauer said:
Am Fri, 25 Aug 2006 12:38:41 +0200 schrieb Thorsten Stadelmann:

ItemSend is fired *before* the message is actually sent. That doesn´t work.
Simply set the mentioned property, that should do it.

What is an "UnsendMsgBox", do you mean the Outbox (Postausgang)? Does that
also happen if you do not move the message but only set the
SaveSentMessageFolder property? If so, please check such an item in the
Outbox: is the font italic or not?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

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" ?


Michael Bauer said:
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 =[/QUOTE]
Application.GetNamespace("MAPI").Folders("Postfach -[QUOTE]
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 ?




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

Michael Bauer [MVP - Outlook]

Am Thu, 31 Aug 2006 16:45:14 +0200 schrieb Thorsten Stadelmann:

Thorsten, please use a tool like OutlookSpy from www.dimastr.com. With that
you can compare a sent with an unsent message and see what properties on the
unsent are missing. The tool also gives you the necessary property ids for
editing those properties which aren´t available via Outlook.

But I stick with that: Moving the item before it was sent is not the way to
go. If you don´t get it working with the SaveSentMessage property then you
could track the ItemAdd event of the SentItems folder and move the message
from within that event.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Hi again,

my code is runnin fine now.

I use:
Code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim MyFolder As MAPIFolder
Set MyFolder = Application.GetNamespace("MAPI").Folders("Postfach -
special-sender").Folders("Gesendete Objekte")

If Item.SentOnBehalfOfName = "special-sender" Then
Item.Move MyFolder

End If
End Sub

to move messages from a special sender to a echange send folder.

But still got one small Problem.

The moved messages got no informations like Date of send.
It would be nice to have the information to do a sort.

An suggestions to set the date of the moved msg ?

--
Thorsten


Michael Bauer said:
Am Fri, 25 Aug 2006 12:38:41 +0200 schrieb Thorsten Stadelmann:

ItemSend is fired *before* the message is actually sent. That doesn´t work.
Simply set the mentioned property, that should do it.

What is an "UnsendMsgBox", do you mean the Outbox (Postausgang)? Does that
also happen if you do not move the message but only set the
SaveSentMessageFolder property? If so, please check such an item in the
Outbox: is the font italic or not?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top