I still think you shouldn't use use GetSharedDefaultFolder. Instead, walk
the folder hierarchy down from the top of the mailbox.
Also note: The newsgroup interface you are using apparently does not quote
earlier messages in the thread, making your latest message so short on
detail that you risk not getting the answer you're looking for. Please take
the time to quote the original message.

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
>>>>From: Barney Mowder
>>>>Date Posted: 11/15/2004 2:53:00 PM
[quoted text clipped - 53 lines]
>>>>
>>>> Set objRecipient =
objNameSpace.CreateRecipient("SPECIAL_ACCOUNT")
>>>> Set objFolder =
objNameSpace.GetSharedDefaultFolder(objRecipient,
olFolderInbox).folders("ReSubject")
>>>>
>>>> Set objSel = objApp.ActiveExplorer.Selection
[quoted text clipped - 21 lines]
>>>> Set objReItem = CreateObject("Redemption.SafeMailItem")
>>>> objReItem.Item =
objOlItem.Attachments.Item(iIdx0).EmbeddedMsg
>>>> If (objReItem.Item.Class = olMailItem) Then
>>>> If (objReItem.SenderName = "SPECIAL_ACCOUNT") Then
[quoted text clipped - 26 lines]
>>>>
>>>>End Sub
>>>From: Sue Mosher [MVP-Outlook]
>>>Date Posted: 11/15/2004 4:58:00 PM
>>>
>>>I bet if you took out the On Error Resume Next, you'd get an error
that
>>>objFolder doesn't exist. I don't think you can get a subfolder in a
shared
>>>mailbox that way. Instead, you should try walking the folder
hierarchy from
>>>the top of the mailbox down (see
>>>http://www.outlookcode.com/d/code/getfolder.htm).
>>From: Barney Mowder
>>Date Posted: 11/15/2004 8:22:00 PM
[quoted text clipped - 21 lines]
>>
>> Any further thoughts? I really appreciate your spending BrainWidth
on
>>this; it's got me barking.
>>
>>Barney
>From: Sue Mosher [MVP-Outlook]
>Date Posted: 11/16/2004 5:30:00 AM
[quoted text clipped - 6 lines]
>detail that you risk not getting the answer you're looking for. Please take
>the time to quote the original message.
Sue-
Dang. Sorry about the trunc'd post- I did a cut & paste this time to
preserve context. Hope it helps.
I don't know of any other way to find the top of the special account's
mailbox than the GetSharedDefaultFolder method- It's not a public
folder.
See, the scenario is this: I have an Outlook session open as me
(Barney Mowder).
I have the special account's mailbox open in the same session. The
macro code I am using is native to my account. If I use
GetDefaultFolder(6), I get MY inbox.
I need an unambiguous way to point to the top of the special account's
inbox, so I can use the objFolder.Folders("ReSubject") method to point
to (walk down to) the appropriate folder.
How (if not GetSharedDefaultFolder) do I get a pointer to the top of
the special account's mailbox from MY session?
Yet again, thanks for your skull sweat. I really appreciate it.
Barney
Sue Mosher [MVP-Outlook] - 16 Nov 2004 21:16 GMT
> How (if not GetSharedDefaultFolder) do I get a pointer to the top of
> the special account's mailbox from MY session?
To get a non-default folder, you need to walk the folder hierarchy using the
Folders collections or use a function that does that for you. See
http://www.outlookcode.com/d/code/getfolder.htm

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
>>>>>From: Barney Mowder
>>>>>Date Posted: 11/15/2004 2:53:00 PM
[quoted text clipped - 189 lines]
>
> Barney
Barney Mowder - 16 Nov 2004 22:37 GMT
All-
Well, heck. I tried to paste the past postings into the last reply, but
the site (www.developersdex.com/bv/newmessage.asp) seeems to have
decided that I've said enough, and trunc'd the reply. Don't know a
workaround for this. Sorry.
Sue Mosher [MVP-Outlook] - 16 Nov 2004 22:40 GMT
The key thing is to keep enough info in your latest post so someone just
getting into the conversation can understand it. In other words, just the
latest code snippets, for example, not everything.
Did you try have a chance to what I suggested?

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> All-
>
> Well, heck. I tried to paste the past postings into the last reply, but
> the site (www.developersdex.com/bv/newmessage.asp) seeems to have
> decided that I've said enough, and trunc'd the reply. Don't know a
> workaround for this. Sorry.
Barney Mowder - 17 Nov 2004 00:46 GMT
>>From: Barney Mowder
>>Date Posted: 11/16/2004 3:50:00 PM
>> All-
>>
>> Well, heck. I tried to paste the past postings into the last reply,
but
>> the site (www.developersdex.com/bv/newmessage.asp) seeems to have
>> decided that I've said enough, and trunc'd the reply. Don't know a
>> workaround for this. Sorry.
>>
>> From: Sue
Mosher [MVP-Outlook]
>From: Sue Mosher [MVP-Outlook]
>Date Posted: 11/16/2004 5:20:00 PM
[quoted text clipped - 4 lines]
>
>Did you try have a chance to what I suggested?
Sue-
I haven't tried your suggestion because I can't figure out HOW to get
to the head of the special account's mailbox.
I looked at your code sample, but it doesn't seem to apply to the
present scenario (though I have been wrong before).
The situation is this: The special account's mailbox is not public.
It is a separate mailbox. I have an outlook session which is logged in
under my username, and I have the special account's mailbox open in that
session. The macros are to run from my account.
I thought GetSharedDefaultFolder WAS the way to reference the special
account's mail box. If I use GetDefaultFolder(6), it returns a pointer
to MY Inbox, but I need to get to the special account's inbox.
Does any of this make sense? If I seem confused, it's because I am.
Thank you again for your extreme patience,
Barney
Barney Mowder - 17 Nov 2004 00:56 GMT
Sue-
Whu is that the obvious never strikes you until AFTER you hit the send
key? Never mind my last post. I DO see the poing, and I'll lrt you
know how it works out. Again, Many, many thanks.
Barney
Barney Mowder - 17 Nov 2004 02:17 GMT
Sue-
I took your suggestion.
I swiped the GetFolder function verbatim from
http://www.outlookcode.com/d/code/getfolder.htm) to eliminate
variability in outcome, and tested the function against items in my own
mailbox, and it works like a champ. NICE code.
Having done that, I changed my macro code to take advantage of
GetFolder, as below:
========================== snip ==========================
Sub SetSubjSID()
Dim objApp As Application
Dim objFolder As Object
Dim objSel As Selection
Dim objItem As Object
Dim wString As String
Dim iIdx0 As Integer
Dim objSafeMail As Object
Set objSafeMail = CreateObject("Redemption.SafeMailItem")
Set objApp = GetObject(, "Outlook.Application")
'All the objFolder assignment is replaced by a single call ot GetFolder
Set objFolder = GetFolder("Mailbox -
SPECIAL_ACCOUNT\Inbox\ReSubject")
'testing the returned folder value
MsgBox objFolder.Name
'it returns "ReSubject"
Set objSel = objApp.ActiveExplorer.Selection
For Each objItem In objSel
DoEvents
If bAbort = True Then
GoTo EndSub
End If
If (objItem.Class = olReportItem) Then
wString = GetRecip(objItem)
objItem.Subject = wString
objItem.Save
ElseIf (objItem.Class = olMailItem) Then
If (objItem.Attachments.Count) Then
wString = ""
Dim Recip
Dim objOlItem As Object
Set objOlItem = CreateObject("Redemption.SafeMailItem")
objOlItem.Item = objItem
For iIdx0 = 1 To objOlItem.Item.Attachments.Count
Dim objReItem As Object
Set objReItem = CreateObject("Redemption.SafeMailItem")
objReItem.Item =
objOlItem.Attachments.Item(iIdx0).EmbeddedMsg
If (objReItem.Item.Class = olMailItem) Then
If (objReItem.SenderName = "SPECIAL_ACCOUNT") Then
For Each Recip In objReItem.Recipients
wString = Recip.Name
Next Recip
End If
End If
Set objReItem = Nothing
Next iIdx0
If (wString <> "") Then
objItem.Subject = wString
objItem.Save
Set objItem = objItem.Move(objFolder)
DoEvents
End If
Set Recip = Nothing
Set objOlItem = Nothing
End If
End If
Next
EndSub:
bAbort = False
Set objItem = Nothing
Set objSel = Nothing
Set objFolder = Nothing
Set objApp = Nothing
End Sub
========================== snip ==========================
Result:
The Msgbox test displays "ReSubject". The correct folder is being
returned.
The objItem.Move(ObjFolder) call returns not a quibble about the moce
request.
It still does NOT move the item to the "ReSubject" folder.
What's the next thing I'd try if I were you?
Barney
Sue Mosher [MVP-Outlook] - 17 Nov 2004 03:44 GMT
Well, at least we can be more certain that you have a folder there. Have you
checked permissions on the target folder? What happens if you simplify it
down to
For Each objItem In objSel
Set objMovedItem = objItem.Move(objFolder)
Next
just for the sake of experiment?

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> Sue-
>
[quoted text clipped - 101 lines]
>
> Barney