PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Anyone Remember PROFS?

Reply

Anyone Remember PROFS?

 
Thread Tools Rate Thread
Old 09-08-2004, 07:48 PM   #1
Chris
Guest
 
Posts: n/a
Default Anyone Remember PROFS?


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


  Reply With Quote
Old 09-08-2004, 08:27 PM   #2
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: Anyone Remember PROFS?

You forgot that SaveSentMessageFolder is an object property (MAPIFolder) and
therefore requires the Set keyword. See
http://www.outlookcode.com/d/code/setsavefolder.htm for a VBA code sample
that's close to what you're doing.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Chris" <AccessCaz@pobox.com> wrote in message
news:u5FD2NkfEHA.904@TK2MSFTNGP09.phx.gbl...
> 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
>
>



  Reply With Quote
Old 09-08-2004, 08:41 PM   #3
Dmitry Streblechenko \(MVP\)
Guest
 
Posts: n/a
Default Re: Anyone Remember PROFS?

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


"Chris" <AccessCaz@pobox.com> wrote in message
news:u5FD2NkfEHA.904@TK2MSFTNGP09.phx.gbl...
> 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
>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off