Anyone Remember PROFS?

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I know I'm showing my age...

One of my favorite things about PROFS was the very easy ability to define a
momentary destination folder for the copy of my e-mail that I'm about to
send. Outlook lets you do this after a gazillion clicks and menu selections
(View | Options, (persistently) checking "Save Sent Messages to:" and
browsing for a folder). In PROFS, all one had to do was type ".pf
foldername" on a dedicated line.

After poking around in Application_ItemSend, I found that the property
SaveSentMessageFolder appeared to be what I was after; when I changed it
through the menus as described above, this property also changed.

So I figured all I had to do was create a little function to search for the
".pf" string, get the value typed, and override the above property before
the end of Application_ItemSend. All this did, however, was change the name
of my Sent Items folder to whatever name I chose. What am I doing wrong?
I'm kinda self-taught in the VBA arena, so no qualms about correcting my
form are expected/required. :)

*property override:

objItem.SaveSentMessageFolder = GetSentMessageFolder(objItem.Body)

*function (in it's infancy, it doesn't yet remove the .pf line, nor validate
the folder name (have NO idea how to do that yet), just at the moment
getting the folder name:

Public Function GetSentMessageFolder(sBody As String) As String
Dim i As Integer
Dim ii As Integer
i = InStr(sBody, ".pf")
If i > 0 Then
ii = InStr(i + 3, sBody, vbCrLf)
GetSentMessageFolder = Mid(sBody, i + 4, ii - (i + 4))
Else
GetSentMessageFolder = "Sent Items"
End If
End Function
 
GetSentMessageFolder function returns a string, not MAPIFolder, which
changes the default property of the objItem.SaveSentMessageFolder object,
which happens to be Name.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top