Question

Outlook 2007 redirect Save Sent Items folder by account

Asked by: BigBadWolf_000

In Outlook 2007 can I redirect "save sent items" folder by account. So if I am sending an email through POP3 account 'A' the sent message copy is saved to a specific folder vs the default 'Sent' folder

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-04-14 at 12:03:09ID24321735
Tags

outlook

,

2007

,

snet items

,

redirect

Topics

Outlook Groupware Software

,

Microsoft Office Suite

Participating Experts
2
Points
500
Comments
53

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. redirect outlook pst files - pop3 email, win2003 AD s…
    I have a windows 2003 server with folder redirection setup for My Documents, not using offline file, not using roaming profiles - works great. We use MS Outlook with a pop3 email server (no exchange server). I'm looking for the best way to move the user's pst files off th...
  2. Redirecting sent items
    Is it possible to redirect mail in the sent items folder ( of the users mailbox ) to the sent items folder in a personal folder? we have a 30mb limit on the mailbox size and people regually send mails over 6 - 10mb to clients. we need to redirect the sent items folder to a p...
  3. Outlook / Exchange Redirect
    Good morning, We have a couple of executives that use BlackBerry phones. They would like all mail sent to their Exchange mailboxes redirected to their phones. I tested this with a redirect rule. This worked fine for all internal mail, but external messages did not forward...
  4. Redirect "Sent Mail" folder in IMAP?
    Hello, I know you can do this in Thunderbird, but I would much rather (for the sake of our users) be able to do this in Outlook. We are going to be using an IMAP email server using the Outlook 2003 client, and I was wondering how (if possible) we could redirect all "sen...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: DiagnosticsPosted on 2009-04-14 at 12:07:09ID: 24141409

Do you not want it to go to your Sent message at all or is it okay if a copy also goes there? Under Tools there is a Rules and Alerts option which can create a rule that can send a copy of your sent item to a folder you specify.

 

by: BigBadWolf_000Posted on 2009-04-14 at 12:15:55ID: 24141496

Yeah I am aware of the copy rule workaround and the change folder for account . But, I want to stay in one PST and move the sent items with no copies.

Am open to using any plugins or code

 

by: DiagnosticsPosted on 2009-04-14 at 12:21:00ID: 24141546

If I may ask, why is it that you don't want a copy in your Sent Items folder? This can help me assess your intentions and aide in possibly coming up with a solution.

 

by: BigBadWolf_000Posted on 2009-04-14 at 12:30:27ID: 24141638

So I keep my PST as clean and manageable with less bloat as possible and no manual interaction :D
Also the copy rule sets copy as Unread in specified folder

 

by: BigBadWolf_000Posted on 2009-04-14 at 21:05:19ID: 24144622

Am also aware of the "...save replies with original message" option, but this too does it for all folders

 

by: DiagnosticsPosted on 2009-04-14 at 21:06:38ID: 24144628

Ouch, now I'm fresh out of ideas. Sorry.

 

by: BigBadWolf_000Posted on 2009-04-14 at 21:28:29ID: 24144696

It will not happen with Outlook native....need a plugin or code

 

by: BigBadWolf_000Posted on 2009-04-14 at 21:55:11ID: 24144787

Found this.....will test to see if it works :D
http://www.sperrysoftware.com/Outlook/Sent-Items-Organizer.asp

 

by: chris_bottomleyPosted on 2009-04-14 at 23:14:52ID: 24145114

It ought to be possible using a rule and a script to detect the sending account ... will that help?

Chris

 

by: BigBadWolf_000Posted on 2009-04-15 at 06:36:18ID: 24147777

Yes I am open to using a script with a rule as long as it moves and not just copies...even better would be if script would move sent message to specific folder by recipient email domain or full email address

 

by: BigBadWolf_000Posted on 2009-04-15 at 06:37:02ID: 24147785

or moves the copy and deletes the original

 

by: chris_bottomleyPosted on 2009-04-15 at 07:06:44ID: 24148091

Which accounts are to be addressed in this way and which folders for the related email to be saved to?

i.e. fred@fred.com ---> fred subfolder of sent items ... or whatever?

Chris

 

by: BigBadWolf_000Posted on 2009-04-15 at 09:05:35ID: 24149629

fred@fred.com Company (folder under root) > Fred (sub-folder under Company) > Sent (sub-folder under Fred)

preffered would be address w/o prefix just @fred.com

 

by: chris_bottomleyPosted on 2009-04-15 at 10:45:05ID: 24150636

OK, one last question I think in order to proceed ... you haven't identified a specific email or range of emails affected.

You originally  said POP account A, I interpret from the last post you want to do it for every email.  If it is only for pop accounts a-z then can you identify how I know which pop accounts are to processed in this way?

Chris

 

by: BigBadWolf_000Posted on 2009-04-16 at 06:44:33ID: 24157586

range of emails....all sent through a POP Account A

There a currently different email domains (3 for now but more in future)  that I send/reply email to strictly through this AccountA...(Outlook 2007 picks it auto for replies/forwards and I pick manually for sends)

So for every email I send/reply through AccountA...
if to @xxx.com then put sent msg in folder Company\xcorp\sent
if to @yyy.com then put sent msg in folder Company\ycorp\sent
if to @zzz.com then put sent msg in folder Company\zcorp\sent

 

by: chris_bottomleyPosted on 2009-04-16 at 07:06:41ID: 24157844

DO you have multiple POP accounts ... it's easier if I can ignore that aspect

Chris

 

by: BigBadWolf_000Posted on 2009-04-16 at 07:18:15ID: 24157985

Yes I have multiple pop accounts, but I want sent items managed only for AccountA

 

by: chris_bottomleyPosted on 2009-04-16 at 10:15:57ID: 24160030

To identify the correct definition can you run this macro which will return all of the POP3 accounts and copy the full text, (from the VBE immediate window) for the one in question here.

Chris

Sub itemisePOP3Accounts()
Dim olkApp As Application
Dim acct As Account
 
    Set olkApp = Outlook.Application
    For Each acct In olkApp.Session.Accounts
        Debug.Print acct.SmtpAddress
    Next
 
End Sub
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:

Select allOpen in new window

 

by: BigBadWolf_000Posted on 2009-04-16 at 10:57:55ID: 24160442

I ran the macro....in the VB Editor....it runs....nothing is output or displayed...
ran it in "this outlook session" and Module1....not result (see image below)

 

by: chris_bottomleyPosted on 2009-04-16 at 11:04:50ID: 24160495

No offence ... the immediate window ctrl  + G to display

 

by: BigBadWolf_000Posted on 2009-04-16 at 11:15:00ID: 24160615

Duh! thanks... :D

It returns the email address associated with the different pop3 accounts....so I have four pop accounts.....just returns the email address for each...I dont want to post the email address here

ssss@domain1.com
dddd@domain2.com
aaaa@domain3.com
zzzz@domain4.com

 

by: BigBadWolf_000Posted on 2009-04-16 at 11:15:57ID: 24160643

the number 4 position is the one associated with the account in question

 

by: chris_bottomleyPosted on 2009-04-16 at 11:17:14ID: 24160674

Understood ... i'll put a constant in that you'll have to set up for the account itself

 

by: BigBadWolf_000Posted on 2009-04-16 at 11:23:45ID: 24160827

sure not a problem....thanks

 

by: chris_bottomleyPosted on 2009-04-16 at 12:22:49ID: 24161497

While I think about it.  In your outlook insert a new code module and put this line of code in:

Public Const Your_MailAccount_Name = "zzzz@domain4.com"

In this way this sensitive data is aved and if you need to copy the code to me it won't accidently get uploaded ... therefore don't put any code I supply in this same module use a second new code module for that purpose.

Chris

 

by: chris_bottomleyPosted on 2009-04-16 at 13:05:00ID: 24161990

>>> if to @xxx.com then put sent msg in folder Company\xcorp\sent

Presumably I would be correct to say:
if to @xxx.com then put sent msg in folder Company\xxx\sent

But where is the root folder ... i.e. the folderpath.
PLace the cursor on the 'root' for the company folder and press enter on the following in the command line:

?application.ActiveExplorer.CurrentFolder.FolderPath

should be something like:
\\Personal Folders\Inbox\Company

Chris

 

by: chris_bottomleyPosted on 2009-04-16 at 13:22:32ID: 24162177

FYI

I have draft code to do this which seems ok to me but is pending the correct folder path construct to finish adapting for your use.

Chris

 

by: BigBadWolf_000Posted on 2009-04-16 at 13:48:42ID: 24162424

got it will do - Public Const Your_MailAccount_Name = zzzz@domain4.com

@xxx.com then put sent msg in folder Company\xxx\sent would be fine

Path for sent messg folder for @xxx.com  = \\Personal Folders\Company\xxx\sent




 

by: chris_bottomleyPosted on 2009-04-16 at 22:51:46ID: 24165127

APologies I cannot fully test the code now but I tested as far as possible last night so place the following two subs into the new module ... the one without the public constant.

Now we need to execute the code.  In 'thisoutlooksession' in teh VBE select application and ItemSend.  In this sub add the line:

    checkPop Item

Now when you send an email that meets the criteria it should be moved as requested.  Let me know how it goes of course.

Chris

Sub checkPop(mai As mailitem)
Dim olkApp As Application
Dim cpy As String
Dim saveFolder As String
'Your_MailAccount_Name  is the account being analysed
 
    If mai.SendUsingAccount = Your_MailAccount_Name Then
        cpy = mai.Recipients.Item(1).Address & ";"
        cpy = Left(cpy, InStr(cpy, ";") - 1)
        cpy = Mid(cpy, InStr(cpy, "@") + 1)
        cpy = Left(cpy, InStr(cpy, ".") - 1)
        '\Personal Folders\Company\xxx\sent
        saveFolder = "\Personal Folders\Company\" & cpy & "\sent"
        mai.SaveSentMessageFolder = olNav2Folder(saveFolder, True)
    End If
 
End Sub
 
Public Function olNav2Folder(foldername As String, Optional createFolders As Boolean) As Object
Dim olApp As Object
Dim olNs As Object
Dim olfldr As Object
Dim reqdFolder As Object
Dim arrFolders() As String
Dim nestCount As Integer
 
    On Error Resume Next
    foldername = Replace(Replace(foldername, "/", "\"), "\\", "")
    If Right(foldername, 1) = "\" Then foldername = Left(foldername, Len(foldername) - 1)
    arrFolders() = Split(foldername, "\")
    Set olApp = CreateObject("Outlook.Application")
    Set olNs = olApp.GetNamespace("MAPI")
    Set reqdFolder = olNs.folders.Item(arrFolders(0))
    For nestCount = 1 To UBound(arrFolders)
        If Not reqdFolder Is Nothing Then
            Set olfldr = reqdFolder.folders
            Set reqdFolder = olfldr.Item(arrFolders(nestCount))
            If reqdFolder <> olfldr.Item(arrFolders(nestCount)) Then
                If createFolders Then
                    reqdFolder.folders.Add (arrFolders(nestCount))
                    Set olfldr = reqdFolder.folders
                    Set reqdFolder = olfldr.Item(arrFolders(nestCount))
                Else
                    Set reqdFolder = Nothing
                    Exit For
                End If
            End If
        Else
        End If
    Next
    Set olNav2Folder = reqdFolder
    Set olApp = Nothing
    Set olNs = Nothing
    Set olfldr = Nothing
    Set reqdFolder = Nothing
End Function
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:

Select allOpen in new window

 

by: BigBadWolf_000Posted on 2009-04-17 at 09:18:22ID: 24169361


Did in thisOutlooksession...

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
checkPop Item
End Sub

Module 1...
Public Const Your_MailAccount_Name = "support@abc.com"

Module 2...
In path:        
your two subs, changed Company to ABC (folder in outlook is upper case so matched it)
changed 'sent' to 'Sent' (folder in outlook 'S' upper case so matched it)
saveFolder = "\Personal Folders\ABC\" & cpy & "\Sent"

In Outlook...
Made sure if recepients email is zzz@mydomain.com
then set sub-company folder name to mydomain (lowercase)

Sent email to zzz@mydomain.com from account support@abc.com
did above for another recipient with different domain

Did not work....message went to default Outlook Sent Items folder

-----------------------------------------

Just to test I tried using the pop account name as it appears in Outlook ...account properties....more settings....account name.

i.e. ABCcorp

got results below...

Error...

Run-time error '13':
Type mismatch

On Debug...
mai.SaveSentMessageFolder = olNav2Folder(saveFolder, True)

-----------------------------------------

Hope this helps, and thank you very much for staying with this.

 

by: BigBadWolf_000Posted on 2009-04-17 at 09:21:09ID: 24169402

For visual reference...

 

by: chris_bottomleyPosted on 2009-04-17 at 10:29:10ID: 24170072

saveFolder = "\Personal Folders\ABC\" & cpy & "\Sent
should be
saveFolder = "\\Personal Folders\ABC\" & cpy & "\Sent

Any change?

 

by: BigBadWolf_000Posted on 2009-04-17 at 10:54:00ID: 24170295

made change (added extra  \) ...tested ....did not work

 

by: chris_bottomleyPosted on 2009-04-17 at 11:30:00ID: 24170595

OOPS!

Replace
        mai.SaveSentMessageFolder = olNav2Folder(saveFolder, True)
with
        mai.SaveSentMessageFolder = olNav2Folder(saveFolder)

Chris

 

by: BigBadWolf_000Posted on 2009-04-17 at 12:56:47ID: 24171501

Made change, Did not work....

 

by: chris_bottomleyPosted on 2009-04-17 at 13:34:52ID: 24171816

OOPS 2!

Replace
        mai.SaveSentMessageFolder = olNav2Folder(saveFolder)
with
        set mai.SaveSentMessageFolder = olNav2Folder(saveFolder)

Chris

 

by: BigBadWolf_000Posted on 2009-04-17 at 15:55:44ID: 24172578

Did that, unfortunately did not work....

 

by: chris_bottomleyPosted on 2009-04-17 at 20:21:27ID: 24173446

In what way didn't work, ay relevant info?

 

by: chris_bottomleyPosted on 2009-04-17 at 20:27:18ID: 24173478

Also examine the company etc in the potential  folder names for invalid characters:

Invalid Chars in Outlook:     / \ * ? < >
Invalid Chars in Exchange: / \ * ? < > | " ; : + [ ] & ~
Invalid Chars in OWA:        / \ * ? < > | " ; : + [ ] & ~ . #

Chris

 

by: BigBadWolf_000Posted on 2009-04-18 at 09:46:30ID: 24175911

Using outlook as a client no exchange involved.....when I send a message via AccountA the message ends up in the default 'Sent Items' folder no errors popup.

folder names have no invalid characters...they follow the email domain so there are no spaces...however one does have a -   i.e. xyz-asdf  ....but its does not work for any of the others either.

is there a way to log the actions of the macro to see whats happening???

 

by: chris_bottomleyPosted on 2009-04-18 at 12:13:33ID: 24176402


Is the new folder created

 

by: BigBadWolf_000Posted on 2009-04-18 at 15:53:20ID: 24177112

by the script...no...I already have the folders manually created...

\\Personal Folders\ABC\mydomain\Sent

 

by: chris_bottomleyPosted on 2009-04-18 at 23:20:16ID: 24178044

I've sat and tested and pasted/restructured but didn't quite figure the actual error.  I think there were a couple of overlapping error confusing me!

The code below works for sure so replace both the checkpop and the olNav2Folder functions from the snippet

Chris

Sub checkPop(mai As mailitem)
Dim fldr As Object
Dim olkApp As Application
Dim cpy As String
Dim saveFolder As String
'Your_MailAccount_Name  is the account being analysed
 
    If LCase(mai.SendUsingAccount) = LCase(Your_MailAccount_Name) Then
        cpy = mai.Recipients.Item(1).Address & ";"
        cpy = Left(cpy, InStr(cpy, ";") - 1)
        cpy = Mid(cpy, InStr(cpy, "@") + 1)
        cpy = Left(cpy, InStr(cpy, ".") - 1)
        '\Personal Folders\Company\xxx\sent
        saveFolder = "\\Personal Folders\Company\" & cpy & "\sent"
        Set fldr = olNav2Folder(saveFolder, True)
        Set mai.SaveSentMessageFolder = fldr
    End If
 
End Sub
 
Public Function olNav2Folder(foldername As String, Optional createFolders As Boolean) As Object
Dim olApp As Object
Dim olNs As Object
Dim olfldr As Object
Dim reqdFolder As Object
Dim arrFolders() As String
Dim nestCount As Integer
 
    On Error Resume Next
    foldername = Replace(Replace(foldername, "/", "\"), "\\", "")
    If Right(foldername, 1) = "\" Then foldername = Left(foldername, Len(foldername) - 1)
    arrFolders() = Split(foldername, "\")
    Set olApp = CreateObject("Outlook.Application")
    Set olNs = olApp.GetNamespace("MAPI")
    Set reqdFolder = olNs.folders.Item(arrFolders(0))
    For nestCount = 1 To UBound(arrFolders)
        If Not reqdFolder Is Nothing Then
            Set olfldr = reqdFolder.folders
            Set reqdFolder = olfldr.Item(arrFolders(nestCount))
            If reqdFolder <> olfldr.Item(arrFolders(nestCount)) Then
                If createFolders Then
                    reqdFolder.folders.Add (arrFolders(nestCount))
                    Set olfldr = reqdFolder.folders
                    Set reqdFolder = olfldr.Item(arrFolders(nestCount))
                Else
                    Set reqdFolder = Nothing
                    Exit For
                End If
            End If
        Else
        End If
    Next
    Set olNav2Folder = reqdFolder
    Set olApp = Nothing
    Set olNs = Nothing
    Set olfldr = Nothing
    Set reqdFolder = Nothing
End Function
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:

Select allOpen in new window

 

by: BigBadWolf_000Posted on 2009-04-19 at 10:05:15ID: 24179757

Did it...no luck...did not work...same results as before.

Chris, are you testing with a POP account on Outlook 2007?

 

by: chris_bottomleyPosted on 2009-04-19 at 10:31:27ID: 24179831

Absolutely.

Try deleting the specific sub folder ... when working the script will create the folder unde company.  It will then give some evidence to work off.

Chris

 

by: BigBadWolf_000Posted on 2009-04-19 at 11:28:33ID: 24180057

Deleted the sub folder under company....no effect....script did not create sub folder and sent item remains in Sent Items folder.

Does your script wait for the message to go to Sent Items folder and then move it to the desired folder? if not ...maybe thats a direction that may work.

The reason I say that is cause I downloaded a trial version of the commercial sw I mentioned in the above posts. Its a plugin not a vb module.I notice the sent message first goes to the Sent Items folder and a second later it is moved to the desired folder.

 

by: chris_bottomleyPosted on 2009-04-19 at 11:39:54ID: 24180096

'my' solution actually changes the email as part of the send action so that it is saved straight away to the required folder.  I will repost the code now to 'stop as soon as it's triggered so let's see if it runsd at all!

If it stops then press F8 time and again and see which lines of code are executed.

Chris

Sub checkPop(mai As mailitem)
Dim fldr As Object
Dim olkApp As Application
Dim cpy As String
Dim saveFolder As String
'Your_MailAccount_Name  is the account being analysed
 
    Stop
    If LCase(mai.SendUsingAccount) = LCase(Your_MailAccount_Name) Then
        cpy = mai.Recipients.Item(1).Address & ";"
        cpy = Left(cpy, InStr(cpy, ";") - 1)
        cpy = Mid(cpy, InStr(cpy, "@") + 1)
        cpy = Left(cpy, InStr(cpy, ".") - 1)
        '\Personal Folders\Company\xxx\sent
        saveFolder = "\\Personal Folders\Company\" & cpy & "\sent"
        Set fldr = olNav2Folder(saveFolder, True)
        Set mai.SaveSentMessageFolder = fldr
    End If
 
End Sub
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:

Select allOpen in new window

 

by: BigBadWolf_000Posted on 2009-04-19 at 12:17:44ID: 24180222

Did it ...same results
I have the images in exact sequence of what line it runs after each F8 starting with Stop....


 

by: chris_bottomleyPosted on 2009-04-19 at 13:06:04ID: 24180372

So the mail account name isn't being detected ... it's nnot ther case as that is forced to low.

SInce you cannot advise the mail account you need to double check the definition of your_mailaccount_name in teh public file.

When the code stops on that line type in the immediate window:

?mai.SendUsingAccount
then
?Your_MailAccount_Name

And line the two outpus up and see where they are different.

Chris

 

by: BigBadWolf_000Posted on 2009-04-19 at 15:36:59ID: 24180905

IT WORKS!!! it was the 'Your_MailAccount_Name' constant....

A summary of why...for reference...

"To identify the correct definition can you run this macro..."
This script provided the email address of AccountA (aaa@mydomain.com)
So we used...
Public Const Your_MailAccount_Name = "aaa@mydomain.com"

In my message "04/17/09 09:18 AM, ID: 24169361" I mentioned...
"Just to test I tried using the pop account name as it appears in Outlook ...account properties....more settings....account name."
But this caused an error cause the script had a few ooops' at the time

I never tried that again...till I saw your latest post and changed the public constant to....
Public Const Your_MailAccount_Name = "AccountA"
AccountA is the name given to the account in "more Settings" in account properties..see image below.

It works great......THANK YOU,THANK YOU,THANK YOU,THANK YOU,THANK YOU,THANK YOU, VERY MUCH...You are AWESOME...and thanks for being patient and staying with me on it. I am estatic.

 

by: BigBadWolf_000Posted on 2009-04-19 at 15:54:00ID: 31570096

Thank You!!!

 

by: chris_bottomleyPosted on 2009-04-19 at 22:06:04ID: 24181994

Steady on! ... you'll burst a blood vessel ;o)

Glad to help in the end and sorry it took so long to close it out but I have learned, (I hope) to allow for the displayed name.

Chris

 

by: BigBadWolf_000Posted on 2009-04-19 at 22:49:54ID: 24182141

hahahhahahahhah....in the words of Maya Angelou....All great achievements require time...I learnt a lot too... :)

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...