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

Sending a copy of an incoming email to a network folder



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 20th 09, 05:08 AM posted to microsoft.public.outlook.program_vba
ROBBOLL
external usenet poster
 
Posts: 2
Default Sending a copy of an incoming email to a network folder

Is there example code to do the following:

You receive an email like: TID(123) This is the subject

The email goes to your inbox as usual, but since it's a "TID(" it moves it
to its matching folder on the network: \\myserver\myemail\TID(123)?

Thanks for any code examples, methods, or suggestions.

RBollinger
  #2  
Old December 21st 09, 08:16 PM posted to microsoft.public.outlook.program_vba
JP[_3_]
external usenet poster
 
Posts: 201
Default Sending a copy of an incoming email to a network folder

Since you want it to be saved automatically, you'll need an event
handler. See http://www.codeforexcelandoutlook.co...ck-event-code/
for starter code.

To save the message, use the MailItem.SaveAs method.

http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

Since the folder name is determined by the subject, you'll need to
check the server for a folder with the same content as the subject,
and create the folder if it doesn't exist. i.e.

' check if folder exists
Dim fldr As String
fldr = Dir("\\myserver\myemail\" & MailItem.Subject)
If Len(fldr) = 0 Then
' folder doesn't exist, create it
MkDir "\\myserver\myemail\" & MailItem.Subject
End If

' save the msg to folder here

--JP

On Dec 20, 12:08*am, ROBBOLL
wrote:
Is there example code to do the following:

You receive an email like: *TID(123) This is the subject

The email goes to your inbox as usual, but since it's a "TID(" it moves it
to its matching folder on the network: *\\myserver\myemail\TID(123)?

Thanks for any code examples, methods, or suggestions.

RBollinger

 




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
Using "Rules" to copy incoming email into a folder. Mark - outlook Outlook and VBA 2 August 4th 07 02:24 PM
Copy email before sending into a database [email protected] Outlook and VBA 1 July 3rd 07 04:26 PM
After Sending Email: Save Copy of Message to Windows Folder Ben Outlook and VBA 1 March 25th 06 07:17 AM
Outlook--Sending a Copy of a Message to a Specific Folder [email protected] Outlook - General Queries 4 March 5th 06 07:26 PM
want to copy distribution list from incoming email to my contacts mcdonn19 Outlook - Using Contacts 1 January 9th 06 09:55 PM


All times are GMT +1. The time now is 03:38 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.