Two Part Questions Public Journals and Windows Explorer

  • Thread starter Thread starter Mike_Bee
  • Start date Start date
M

Mike_Bee

I would like to know if there is a code out there that
will use actions (i.e. Message to Contact) in a public
contact list and log it automaticly in a public journal
folder. I really do not want to purchase any add-ins,
but if I do have to I would like to try a trial verison.

Second Question:
Is there a way to access windows explorer while in a
specific contact and have it link directly to the contact
file folder.
 
Paste this code into ThisOutlookSession module of Outlook VBA:

Public WithEvents myOlSentItems As Outlook.Items

Public Sub Initialize_handler()
Set myOlSentItems = Outlook.GetNamespace("MAPI").GetDefaultFolder(olFolderSentMail).Items
End Sub

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If Item.MessageClass = "IPM.Note" Then

'The following lines are necessary so that if you do a Mail Merge with MS Word, that the user isn't prompted for each and every mail being sent.

If Not Item.GetInspector.IsWordMail = True Then
Item.BillingInformation = ""
Else
Item.BillingInformation = "W"
End If
End If
End Sub

Private Sub Application_Startup()
Initialize_handler
End Sub

Private Sub myOlSentItems_ItemAdd(ByVal Item As Object)
Dim newJournalFolder As MAPIFolder
Dim myJournalItem As MailItem

Set newJournalFolder = Application.Session.Folders("Public Folders").Folders("All Public Folders").Folders("All Mail")

If Not Item.BillingInformation = "W" Then
Set myJournalItem = Item.Copy
End If

If TypeName(myJournalItem) <> "Nothing" Then

'Ask the user if the sent item should be journaled

Set newJournalFolder = Application.Session.Folders("Public Folders").Folders("All Public Folders").Folders("Public Journal")

If myJournalItem.MessageClass = "IPM.Note" Then
JournalResponse = MsgBox("Would you like to Journal the item: '" & Item.Subject & "'?", vbYesNo, "Continue")
If JournalResponse = 6 Then
myJournalItem.Move newJournalFolder
Else
Item.Delete
End If
End If
Set NS = Nothing
Set newJournalFolder = Nothing
Set myJournalItem = Nothing
End If
End Sub

Of coarse, this code assumes that you have a Public Folder named "Public Journal" that holds mail items and all users have permission to save items to it.

This only works with items sent to public contacts (or any contacts for that matter) to move it (when desired) to the Public Journal.

I also have a similar solution for incoming mail. That code is a little more complex because you don't want to ask to journal until after it has been read and you don't want to ask for everytime they read the mail, just the first time.

John Riddle
 
Back
Top