Link to home
Start Free TrialLog in
Avatar of 4jevans
4jevans

asked on

Journal entry is saving to wrong Contacts folder

I have two PSTs in my profile. My main one has all the normal folders (Contacts, Calendar, Inbox, etc.) and the second PST has only a Contacts, Journal, and Deleted Items folder. Whenever I "Add an New Journal Entry" to a contact in this second folder and click "Save," the journal entry is saved to the Journal folder of the first (main) PST file. I have to manually move each new item  to the correct Journal folder then delete it from the screen. This involves canceling several "error" messages and is quite cumbersome as I have to do it for every new journal item I create. Is there any way to have Journal items save to the correct folder?
Thanks in advance.
Avatar of SnowFlake
SnowFlake
Flag of Israel image

Journal Items save to the jurnal folder of the contact's owner's mailbox.

As far as I know you cant work with two journal folders at the same time in different pst's and have journals writen to the "appropriate" pst.

if you know in advance that you are going to do actions with one of the folders you can set up two profiles, each with one pst only and change profiles as needed.

SnowFlake.

P.S. this knid of problems also occur when you try and have a shared pst between two people.
Hi 4Jevans,

You currently have 2 questions that remain ungraded or unresolved.

Have any of the solutions offered above resolved your problem?
Here are some options:
Select the expert answer that best resolved your problem.
If more then one expert helped you solve your problem and
you would like to divide the points: Post a 0 point question
in the Community Support area
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt 
and add a link that points back to this question.

If the solutions above did not resolve your problem:
1. Create a 0 point question that links back to this question.
Sometimes trying other queues will bring more responses
https://www.experts-exchange.com/jsp/zonesAll.jsp
2. Post a 0 point question in the Community Support area
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
and add a link that points back to this question, with a
request to have points awarded back to your account.
Avatar of 4jevans
4jevans

ASKER

Thank you. I have posted a 0 point question elsewhere on the site redirecting people to this question.
You need to set it up with TWO pst files AND two PROFILES. They don't share one, they each have their own. I do this all the time. When you initially set up the profile, you get prompted for what pst to use when you define personal folders. If you select the SAME one as another profile, they will share it. If you select a DIFFERENT one (and it doesn't have to exist, it will be created), they will have totally separate personal folders, journals, calendars, etc. They can even have a separate PAB (address book) as well.

I do this all the time, it's really great. You can have multiple people/accounts set up with different profiles, and everything stays nice and separate.

Each profile uses a PST file -- you can't have two for one profile.

Change your settings to prompt for the profile to be used, and you'll be able to pick which one when you start Outlook. They will be completely separate -- and if you start with a blank PST, you won't carry over anything that you already have.
Avatar of 4jevans

ASKER

Webwoman: You say "Each profile uses a PST file -- you can't have two for one profile."

Well, I DO have two (in fact, three) PST files in one profile and I don't want to have to exit one profile, restart Outlook, choose another profile just to add an entry to the correct Journal folder. I am already aware that I can set up two discrete PSTs in separate profiles. What I'm looking for is a way around that. Outlook allows you to use as many PSTs in a profile as you want; however, whereas you can save contact, calendar, and e-mail info to the correct PST, a new journal entry is always written to the "main" PST and has to be manually moved to the correct one. Actually, that is a lot easier than the method you and Snowflake described, of creating separate profiles and having to switch between them. If there were a way to do that without closing Outlook and restarting it, I might consider it.
The only way I know of to keep them separate is to have more than one profile. One profile = one set of 'main' folders. You can have more folders and call them anything you want. If you delete the pst file that goes with that profile, they will ALL disappear. You can't have more than one pst file associated with a profile.


Rename the main pst file and see.
4jevans,

I will add one more idea to what i said earlier,

If you are useing OL2K You might be able create code
that detects when a Journal Item is created and
prompt the user if he wants to move it to another folder,
sort of automating what you are doing manually,
however I don't know what would be the behavior of those items after moved.


Dim WithEvents oJournalItems As Outlook.Items

Private Sub Application_Startup()
   Set oJournalItems = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderJournal).Items
End Sub

Private Sub oJournalItems_ItemAdd(ByVal Item As Object)
    Dim jItem As JournalItem
    Set jItem = Item
    Dim targetFOlder As MAPIFolder
    Set targetFOlder = Application.GetNamespace("MAPI").Folders("AlternativeMailbox").Folders("journal")
    jItem.Move targetFOlder
End Sub


SnowFlake.
Avatar of 4jevans

ASKER

SnowFlake, thanks, I'll give this a try as I am using OL2K. How do I actually use this code though? A macro or something?
on outlook press alt-F11
he vba editor opens up
paste the code on the right side pane.

since some of this code runs on the application_startup event you will have to close outlook and restart it for it to start working.

when you will restart outlook you will get a warning that macros are trying to run, this is normal and you should press "enable macros"

SnowFalke.
Avatar of 4jevans

ASKER

SnowFlake,
I followed your instructions, but to no avail. I get the startup window and enable macros, but when I create and save a journal entry it doesn't ask if I want to move it to another folder. There are probably some steps that I'm not aware of that you may be assuming I know. I have never programmed in Outlook before. I'll double the points if you can help me make this work!
change
Private Sub oJournalItems_ItemAdd(ByVal Item As Object)
   Dim jItem As JournalItem
   Set jItem = Item
   Dim targetFOlder As MAPIFolder
   Set targetFOlder = Application.GetNamespace("MAPI").Folders("AlternativeMailbox").Folders("journal")
   jItem.Move targetFOlder
End Sub



to

Private Sub oJournalItems_ItemAdd(ByVal Item As Object)
   Dim jItem As JournalItem
   Set jItem = Item
   msgbox "New Item Created"
   Dim targetFOlder As MAPIFolder
   Set targetFOlder = Application.GetNamespace("MAPI").Folders("AlternativeMailbox").Folders("journal")
   jItem.Move targetFOlder
End Sub

if you will get the message boxes then i assume the problems is with the AlternativeMailbox exact string

please let me know if you get the msgbox to fire when you create a new item in your journal folder,
if you do get it we can go on.

SnowFlake

Avatar of 4jevans

ASKER

It didn't work. I can't get the msgbox to fire. The new journal item just goes right into the default journal folder when I click 'Save'.
what if you create the item in the other contacts folder ?
do you get a message then ?


try replacing

Private Sub Application_Startup()
  Set oJournalItems = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderJournal).Items
End Sub


with
Private Sub Application_Startup()
  Set oJournalItems = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderJournal).Items
  MsgBox "You should recieve events for folder " & oJournalItems.Parent.Name & " under " & oJournalItems.Parent.Parent.Name
End Sub

close and restart outlook and see of the message reflects the correct journal folder out of which we are trying to move the journal items

SnowFlake
Hello 4jevans.

This question is still open.

What would you like to do with it? Basically, you've got the following options:

1. Award points to the expert who was most helpful.

2. Delete it because the problem's been resolved or no longer exists. Your points are returned to you. This requires no objections from others who posted in your question.

3. PAQ it because the information may be useful, but is not useful to you. Your points are returned to you. This requires no objections from others who posted in your question.

Input from posting Experts on items 2 and 3 is greatly appreciated!

Thank you.
amp
Community Support Moderator
Experts Exchange
Avatar of 4jevans

ASKER

Snowflake, sorry I've been on vacation. I tried your latest module change, but it doesn't work. I think I'm going to withdraw the question because I don't have the patience for trial and error while working on this project. I'm just going to go with manually moving the entries since that's the only way I know how. Thank you (and everyone) for your help though.

Community Support Moderator, please withdraw this question.

Thank you.
Avatar of 4jevans

ASKER

Problem is too complex and involves programming Outlook in VB, which is above my head.
Um, as long as webwoman and snowflake agree, you can call me amp. (Just joking with ya)

Do the experts have any problem with 4jevans getting his/her points back? If not, let me know if you think I should delete it or PAQ it.

If you do, let him/her know why...

Thanks!
amp
Community Support Moderator
Experts Exchange
I would suggest one more thing before you do,
I had simmilar issues with some other Q a while ago,
code i gave worked on my WS but didnt work for the other side.

the reason turned out to be that he was useing IMO,
when he changed to corporate mode is solved his problems,

4jevans, before you give up have a look here:
https://www.experts-exchange.com/jsp/qShow.jsp?ta=msoutlook&qid=20084722

if you are on IMO I suggest you reconfigure your outlook to use corporate mode.

the code i posted here works for me so i don't see why it should not work for you.

amp, weather i get points here or not, i think that the Q is worth PAQing.

SnowFlake
Avatar of 4jevans

ASKER

SnowFlake,
I've always worked in Corporate/Workgroup mode. I guess I need hand-holding through any kind of VB programming in Outlook, and that's a lot to ask. For example, at what point is the message box, etc. supposed to come up -- when I click "Add new Journal entry" or when I save the entry? It doesn't come up in either scenario. Also, am I supposed to substitute names for "Parent.Name" and "Alternative Mailbox"? There isn't an alternative mailbox, just a second PST called "Authors" that has only a Contacts and Journal folder (and Deleted Items). I guess I'm really confused about the terminology in the code.

Yes, amp, please award SnowFlake points for effort and double as promised if we reach a solution, but I haven't reached that point yet.
Then we wait, 4j. Not trying to rush you--just remind you. Thanks for responding. I probably should not have posted my "generic" followup post...

amp
hi again,
sorry i wasn't around.

to answer your Q's:

I will assume the code you have now looks like the following code, note that this is not the original code i posted but i added several msgboxs, changed the mailbox name and added some cleanup code so you should update the code you have:

Dim WithEvents oJournalItems As Outlook.Items

Private Sub Application_Startup()
 msgbox "Application_startup event fired"
 Set oJournalItems = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderJournal).Items
 
 if oJournalItems is nothing then
    msgbox "Could not set oJournalItems"
 else
    msgbox "oJournalItems set to the items collection of folder " & oJournalItems.Parent.Name
    msgbox "The parent of this folder is " & oJournalItems.Parent.Parent.Name
 end if
End Sub

Private Sub oJournalItems_ItemAdd(ByVal Item As Object)
  msgbox "oJournalItems_ItemAdd event fired"
  Dim jItem As JournalItem
  Set jItem = Item
  msgbox "New Item Created"
  Dim targetFOlder As MAPIFolder
  Set targetFOlder = Application.GetNamespace("MAPI").Folders("Authors").Folders("Journal")
  jItem.Move targetFOlder
  set targetFOlder = Nothing
  set jItem = Nothing
End Sub


well, when you close outlook (logout) and start outlook you should get a warning about having macro code and you will be asked if its o.k. to run it, you should allow the code to run.

what should first happen is that the Application_Startup event firres up and he code associated with it runs.
if everythig goes right so far you should get 3 messeges.

let me know if this happens and we'll take it from there.

as for "hand-holding through any kind of VB programming
in Outlook" beeing "a lot to ask", well thats what we are here for: teaching, learning and beeing nice to other people, so there is no problem with this. experts get thair thanks in the for of "thanks" and "accept comment as answer" when appropriate. but the knowladge that you help someone else is not something to disregard.

as for the rest of your Q's, allthough this might be early:

> "For example, at what point is the message box, etc.
> supposed to come up -- when I click "Add new Journal
> entry" or when I save the entry?"
> It doesn't come up in either scenario.

well, refering to the previous code we has since the "New Item Created" msgbox should have poped up when you saved the entry since it is part of the event that fires when a new item is added to the Items collection of the default JournalItems folder (which is the collection I am trying to set oJournalItems to be with the statement:
Set oJournalItems = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderJournal).Items

> Also, am I supposed to substitute names or "Parent.Name"

no you should not since parent is a property of the collection or of a folder so oJournalItems.Parent.Name should be the name of the default JournalItems folder
and oJournalItems.Parent.Parent.Name should be the name of the folder that contains the folder that has the oJournalItems collection.

> and "Alternative Mailbox"? There isn't an alternative
> mailbox, just a second PST called "Authors" that has
> only a Contacts and Journal folder (and Deleted Items).

yes you should and I changed it in the code above to be "Authors", in the statement
Application.GetNamespace("MAPI").Folders("AlternativeMailbox").Folders("journal")

"AlternativeMailbox" is used as an key into the folders collection of the MAPI namespace, when you have only pst's this collection would consist of folder items named by the names of the pst's

> I guess I'm really confused about the terminology in the code

I hope I clear most of it.

Let me know how thing are going and well continue accordingly.

SnowFlake.

Avatar of 4jevans

ASKER

> well, when you close outlook (logout) and start outlook
> you should get a warning about having macro
> code and you will be asked if its o.k. to run it, you
> should allow the code to run.

Copied the new code into the macro editor, saved it and closed OL. When I started it up, I got the screen asking if I wanted to enable/disable macros. I enabled.

> what should first happen is that the Application_Startup
> event firres up and he code associated with
> it runs.
> if everythig goes right so far you should get 3 messeges.
> let me know if this happens and we'll take it from there.

OK, what three messages am I supposed to see? None beyond the enable/disable screen came up. I then tried to create a journal entry and save it, and when I clicked "Save", it saved the entry in the default Journal folder, no option to move it to the "correct" folder.

I appreciate your continued generosity and patience with me. I didn't realize this would get so complicated!

4J
this is wierd,
you should have recieved at least the message that says
"Application_startup event fired".

I realy dont know why is this getting so complicated, its not the macros, it seems like for some reason they are not being executed on you machine.

lets try to force the macros to run:

open the vba editor (ALT-F11) and add the following piece of code:

Public Sub go()
   msgbox "Go activated"
   Application_Startup
   msgbox "Go done"
End Sub

close the vba editor and when in outlook press ALT-F8.

you should get a window called "Macros" that should have
"ThisOutlookSession.go" as one of its lines, select it and press the RUN Button.

Tell me what happends.

SnowFlake.
Avatar of 4jevans

ASKER

I pasted the code into the VBA editor, saved it, then pressed ALT-F8. I got the Macros window, but the only thing listed was "go" (Not "ThisOutlookSession.go"). I selected it, clicked RUN, then got a "Compile Error - Only valid in object module" pop-up message in the VBA editor.

I'm running OL 2000, SR-1. Do I need to install something that isn't installed by default?
I dont think you need to install anything.

when you open the vba editor, and look at the project explorer (looks like an treeview - use ctrl-R to open it if you dont have it), what apeers in this tree ?

I have
Project1 (VbaProject.OTM)
    Microsoft Outlook Objects
           ThisOutlookSession

what does it show at the caption of the vba editor window (the blue title) ?

avobe the code there are two combo boxes, what is options are avaliable on the left one ?


SnowFalke.

Avatar of 4jevans

ASKER

> when you open the vba editor, and look at the project
> explorer (looks like an treeview - use ctrl-R
> to open it if you dont have it), what apeers in this
> tree ?

> I have
> Project1 (VbaProject.OTM)
>    Microsoft Outlook Objects
>           ThisOutlookSession


And I have the same thing, but also branches that say "Forms," "Modules," and "Class Modules." Under "Modules" are "Module1 and Module1. When I click on them, the code you wrote appears.


> what does it show at the caption of the vba editor
> window (the blue title) ?

Microsoft Visual Basic VbaProject.OTM[design] - [This Outlook Session(Code]

> avobe the code there are two combo boxes, what is
> options are avaliable on the left one ?

Are you referring to the drop down boxes that say (General) and (Declarations)?
>> when you open the vba editor, and look at the project
>> explorer (looks like an treeview - use ctrl-R
>> to open it if you dont have it), what apeers in this
>> tree ?

>> I have
>> Project1 (VbaProject.OTM)
>>    Microsoft Outlook Objects
>>           ThisOutlookSession


>And I have the same thing, but also branches that >say "Forms," "Modules," and "Class Modules." Under
>"Modules" are "Module1 and Module1. When I click on them, >the code you wrote appears.

Well I belive we found the problem !
move the code from the its current "Module1" code window
to the code window that apears when you double click on "ThisOutlookSession"

as allways, let me know how things go after the change.

SnowFlake.
Avatar of 4jevans

ASKER

OK, I get the three initial message boxes, but when I try to save a new Journal entry, I get a Run Time error message saying "The operation failed - object could not be found."
SnowFlake, you around?
Avatar of 4jevans

ASKER

That's OK. I've been waiting since early March for a possible solution. 3 days is nothing.
Yes, I am here.

Since it seems now that the events are being fired were not far from the solution.

make the folowing changes and let me know exactly what message boxes you get, in perticular if you get messages 3 or 4 i want to know what exactly they say.

Private Sub Application_Startup()
msgbox "1) Application_startup event fired"
Set oJournalItems = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderJournal).Items
 
if oJournalItems is nothing then
   msgbox "2) Could not set oJournalItems"
else
   msgbox "3) oJournalItems set to the items collection of folder " & oJournalItems.Parent.Name
   msgbox "4) The parent of this folder is " & oJournalItems.Parent.Parent.Name
end if
End Sub


Private Sub oJournalItems_ItemAdd(ByVal Item As Object)
 msgbox "10) oJournalItems_ItemAdd event fired"
 Dim jItem As JournalItem
 Set jItem = Item
 msgbox "11) New Item Created"
 dim mapiNS as namespace
 set mapiNS = Application.GetNamespace("MAPI")
 msgbox "12) Mapi Namespace set"
 Dim AuthorsFolder As MAPIFolder
 Set AuthorsFolder = mapiNS.Folders("Authors")
 msgbox "13) authors folder set"
 Dim targetFOlder As MAPIFolder
 Set targetFOlder = AuthorsFolder.Folders("Journal")
 msgbox "14) target folder set"

 jItem.Move targetFOlder
 set targetFOlder = Nothing
 Set AuthorsFolder = Nothing
 set mapiNS = Nothing
 set jItem = Nothing
End Sub




Avatar of 4jevans

ASKER

I get message boxes: 1, 3, 4

Message box 3 says: "oJournalItems set to the items collection of folder Journal"

Message box 4 says: "The parent of this folder is Jevans"

After clicking 'Save' on a new Journal entry, I get

Message box 10 "oJournalItems_ItemAdd event fired" then
Message box 11 "New Item Created" then
Message box 12 "Mapi Namespace set"

When I click OK after Message box 12, I get the Microsoft Visual Basic Runtime Error box. When I click debug, the line "Set AuthorsFolder = mapiNS.Folders("Authors")is highlighted in yellow.

My God, you're patient. You should be getting paid $ for this. I feel guilty.
so for some reason we can't get to the Authors folder, try this:

Private Sub Application_Startup()
msgbox "1) Application_startup event fired"
Set oJournalItems = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderJournal).Items

if oJournalItems is nothing then
  msgbox "2) Could not set oJournalItems"
else
  msgbox "3) oJournalItems set to the items collection of folder " & oJournalItems.Parent.Name
  msgbox "4) The parent of this folder is " & oJournalItems.Parent.Parent.Name
end if
End Sub


Private Sub oJournalItems_ItemAdd(ByVal Item As Object)
msgbox "10) oJournalItems_ItemAdd event fired"
Dim jItem As JournalItem
Set jItem = Item
msgbox "11) New Item Created"
dim mapiNS as namespace
set mapiNS = Application.GetNamespace("MAPI")
msgbox "12) Mapi Namespace set"
dim tmpFolder as mapiFolder
for each tmpFolder in mapiNS.folders
  msgbox tmpFolder.name
next
Dim AuthorsFolder As MAPIFolder
Set AuthorsFolder = mapiNS.Folders("Authors")
msgbox "13) authors folder set"
Dim targetFOlder As MAPIFolder
Set targetFOlder = AuthorsFolder.Folders("Journal")
msgbox "14) target folder set"

jItem.Move targetFOlder
set targetFOlder = Nothing
Set AuthorsFolder = Nothing
set mapiNS = Nothing
set jItem = Nothing
End Sub
Avatar of 4jevans

ASKER

You're going to kill me. The name of the folder in my Outlook Bar is "Authors" but I checked the actual name of the PST file and it's "UT Contacts." (I'm cringing in shame and want to self-flagellate.) I copied your latest code and it went through all my active folders, then I got the RunTime error when it got to "Authors." Now I see why. Should I try some earlier code you posted? What do I need to change so that it references UT Contacts? I am really embarrassed about this.
try this:

Private Sub Application_Startup()
msgbox "1) Application_startup event fired"
Set oJournalItems = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderJournal).Items

if oJournalItems is nothing then
 msgbox "2) Could not set oJournalItems"
else
 msgbox "3) oJournalItems set to the items collection of folder " & oJournalItems.Parent.Name
 msgbox "4) The parent of this folder is " & oJournalItems.Parent.Parent.Name
end if
End Sub


Private Sub oJournalItems_ItemAdd(ByVal Item As Object)
msgbox "10) oJournalItems_ItemAdd event fired"
Dim jItem As JournalItem
Set jItem = Item
msgbox "11) New Item Created"
dim mapiNS as namespace
set mapiNS = Application.GetNamespace("MAPI")
msgbox "12) Mapi Namespace set"
dim tmpFolder as mapiFolder
'for each tmpFolder in mapiNS.folders
' msgbox tmpFolder.name
'next
Dim AuthorsFolder As MAPIFolder
Set AuthorsFolder = mapiNS.Folders("UT Contacts")
msgbox "13) authors folder set"
Dim targetFOlder As MAPIFolder
Set targetFOlder = AuthorsFolder.Folders("Journal")
msgbox "14) target folder set"

jItem.Move targetFOlder
set targetFOlder = Nothing
Set AuthorsFolder = Nothing
set mapiNS = Nothing
set jItem = Nothing
End Sub
Avatar of 4jevans

ASKER

Well, I get the RunTime error afer saving the journal entry and the debug highlighter is on the:

Set AuthorsFolder = mapiNS.Folders("UT Contacts")

line. Do we need to put in a path or something? This folder is not in the same location as my main PST.

I'm turning in (it's 2:30AM East Coast time. Will check back tom'w.) Thank you so much for working this through with me.

ASKER CERTIFIED SOLUTION
Avatar of SnowFlake
SnowFlake
Flag of Israel 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
Avatar of 4jevans

ASKER

:D It worked!!!! Un-freaking-believable!!! I'm ecstatic! (I had renamed the icon to "UT Contacts" instead of using the full name, so was again not correctly identifying the PST file).

Now...just a comsetic question or two: is there any way to NOT have to click all those message boxes? Also, can OL be started without having to enable macros all the time?

In any event, thank you, thank you, thank you! I will send a postcard posthaste. Email me your address: I'm at jeffevans7@aol.com.
Avatar of 4jevans

ASKER

amp,I upped the points to 600, but got a message afterward that 300 is the max that can be awarded and to "consider a lower amount." I don't see anyway to do that, so I'm assuming it will give the max?
Avatar of 4jevans

ASKER

amp,I upped the points to 600, but got a message afterward that 300 is the max that can be awarded and to "consider a lower amount." I don't see anyway to do that, so I'm assuming it will give the max?
If you wish to post more points for Snowflake, just create another, new question titled "Points for Snowflake", and include the url to this question in it.

Let me know if you need help with that, 4j.

amp
Avatar of 4jevans

ASKER

Thanks, Amp. Did it.
SnowFlake - I have a Q here for you.
https://www.experts-exchange.com/jsp/qShow.jsp?ta=msoutlook&qid=20125824

thanks

PandoraMod
Moderator @ Experts Exchange

ps - do you know how difficult you are to chase down!
PandoraMod : what do you mean "difficult you are to chase down!" ?

4jevans:
first of all I am happy I was able to assist you.
second, as for your request to remove the message boxes,
here is the clear code, mind though that i dont know what you changed the line that looks like
  Set AuthorsFolder = mapiNS.Folders("UT Contacts")
to be so I left it as here and you will have to do the change to it again.

as for the enable macros issue, I know there should be a way to apply a digital signiture to this code but I dont know the excact HOWTO and you will have to get such a digital certificate. Myself I just press the enable whenever I open my outlook. If this is a big issue for you you might consider posting another Q about this, maybe someone else has more information about this.

I will send you my address to the email you posted here,
since I copied it you might want to ask amp or PandoraMod to remove it from the message body (if they can at all).

following is the code without the messageboxes accept for one that should pop up only if there will be trouble.


Private Sub Application_Startup()
Set oJournalItems = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderJournal).Items
if oJournalItems is nothing then
   msgbox "Could not set oJournalItems"
end if
End Sub


Private Sub oJournalItems_ItemAdd(ByVal Item As Object)
  Dim jItem As JournalItem
  Set jItem = Item

  dim mapiNS as namespace
  set mapiNS = Application.GetNamespace("MAPI")
  dim tmpFolder as mapiFolder
  Dim AuthorsFolder As MAPIFolder
  Set AuthorsFolder = mapiNS.Folders("UT Contacts")

  Dim targetFOlder As MAPIFolder
  Set targetFOlder = AuthorsFolder.Folders("Journal")

  jItem.Move targetFOlder
 
  set targetFOlder = Nothing
  Set AuthorsFolder = Nothing
  set mapiNS = Nothing
  set jItem = Nothing
End Sub


SnowFlake
Avatar of 4jevans

ASKER

Thanks, SnowFlake. Got your e-mail. Post card is on the way!
So the code is workng...! Great.

How can I make it portable? I would like to use a custom form instead of "global code"
Parijke,
can you please explain your situation ?
what has this got to do with custom forms ?

do you have many users with this kind of a configuration ?

maybe you can create an external addon ?

SnowFlake