Link to home
Start Free TrialLog in
Avatar of matrix0511
matrix0511

asked on

Can You create Code to Save Outlook Email Messages to Sharepoint Fiscal Year Sub-Folders?

we have separate folders for each fiscal year. remember that? So on the sharepoint root location you will see a folder for 2008, 2009, & 2010. The current fiscal year we are using right now is 2011. But we don't create a folder for that one. We just keep all the folders in the root location.

Once fiscall year 2011 is done, I will create a folder called: 2011 and then move all the current 2011 folders into it. then for fiscall year 2012 I will have the folders in the same root location as they are now for 2011. and will continue on for 2013, 1014, etc. Does that make sense?

And that is what I had mentiond earlier. But not sure if you recall.

So, what that means is if I recieve any emails that reference an "older" fiscal year project number. Like the one I got a while back: "CTH1000024" (fiscal year 2010) or "CTH0900009" (fiscal year 2009) I would need to save that email to that corrisponding fiscal year folder.

I dont' get those older emails that often but I do get them.

I noticed this was still an outstanding issue because when was testing your latest code I pulled up an email that referenced an older fiscal year in the subject line. it was a 2010 project number. so when I clicked the button instead of saving to that 2010 folder on sharepoint, it saved it to the current root location. since it didn't see a folder called: CTH100024 it created it in that location.

How much effort will it be to add code to account for the older existing fiscal folders and also future, like when I finish with these current 2011 folders and then create a new 2011 folder and move onto 2012?

see below for how the older fiscal folders look like and what the project number scheme is inside each one.
      
Avatar of matrix0511
matrix0511

ASKER

Avatar of Chris Bottomley
So for any valid project number i.e. CTH1100062

CTH is a constant
11 is the fiscal year.

So if an email arrives with the current fiscal year, (rules for the fiscal year needed) it is saved as:

 "\\cth-ws01\corp\IT\Shared Documents\Project Documents\CTH1100062...fullname\CTH1100062 ... subject.msg

whereas if is not CTH1000062 then it is saved to a pre-existing subfolder off of:
\\cth-ws01\corp\IT\Shared Documents\Project Documents

It can't be that as the script ought to have seen the existing folders otherwise ... therefore is it the case that the previous fiscal years are the folders simply titled as 2009, 2010 etc?

Chris
Chris, Yes, CTH will always be the constant. Yes, "11" is the current fiscal year.

Yes, if email comes in with a project number that starts with "CTH11" it will save to that sub folder under:

\\cth-ws01\corp\IT\Shared Documents\Project Documents\  in the CTH1100062 folder. And any other emails with that same "CTH11" prefix in the subject line will continue to save in that same Project Documents locaiton in its own respective sub folder for 2011 FY.

However, any emails that come in with ANY OTHER Fiscal Year in the project number (for example CTH0900009 or CTH0800010 or CTH1000050) the code will need to recognize that these are NOT current fiscal year project numbers (for this year it's 2011 - "11") and then copy the email to that specific fiscal year folder and then sub folder.

And once this current FY is over. I will then create a folder called: 2011

and move all current "CTH11" folders into that 2011 folder. and then all new 2012 emails (CTH12) will then be saved in that \\cth-ws01\corp\IT\Shared Documents\Project Documents location. and it will continue that way until 2013 FY.

Does that make sense?
Indeed you confirm my take on the change ... so can you define what you mean by fiscal year - i.e. how it is calculated?

Chris
Yes. Believe me, it can get confusing trying to explain how our fiscal years work.

but to put it simply, for our company, our fiscal year runs March 1st to March 1st.

so, for example, this past March 1st (3-1-2010) was the beginning of our FY 2011. Once we get to next March 1st 2011 next year, that will start our FY 2012.

Get it?? So again, instead of Jan - Dec like a normal year, it runs March 1st to March 1st of the next year.
ASKER CERTIFIED SOLUTION
Avatar of Chris Bottomley
Chris Bottomley
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hey, you mind if I take a few days to fully test this with multiple emails?

IN the interim, question for you. I have Word docs that have to be saved to these share point locations as well. could I copy this code into a new macro and setup a custom macro button and attach it to my menu in Word and click on it to automatically save that doc to my sharepoint location folders?

Actually I just tested and it fails. probably because the code is setup for Outlook and not Word. Huh?


Word.jpg
I will also have Excel Spread sheets that I will need to save as well.

Let me ask you this. could I create a couple of new Experts Exchange questions for you to work on?

You have been absolutely amazing in setting up this code and since to do this same thing in Word and Excel would probaly be easy for you given what yo have done for Outlook I would rather have you work on it vs. having to expalin to someone else from scracth.

let me know and I will create the new questions.

Thanks!
It couldn't be used direct and would need a degree of modification to work since it is specific to emails and outlooks methods.  There are substantial differences to make it work the first time though with careful design it should be possible to use for all MS files.

Chris
Ok. I have created a new question regarding Word And Excel

https://www.experts-exchange.com/questions/26425352/Can-You-create-Code-to-Save-Word-Excel-Documents-to-Sharepoint-Sub-folders.html

ID: 26425352

Thanks Chris! I can't tell you how cool it is to have all this automated! Tremendous!!
 
Tremendous work!!