Solved

Need VBA code to programmatically access the Blocked senders list

Posted on 2006-11-04
10
665 Views
Last Modified: 2008-02-01
I'm writing an app for a friend and I need to be able to programmatically access the Blocked Senders list in Outlook.  I can't find it in the object model and I'm not sure if it's stored in a hidden message, external file, registry or what.

Anybody know?

Tim Jeffryes
0
Comment
Question by:tjeffryes
  • 5
  • 3
  • 2
10 Comments
 
LVL 11

Expert Comment

by:ch2
ID: 17873448
the senders are stored in a registry key:

HKEY_CURRENT_USER\Identities\{xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx\Software\Microsoft\Outlook Express\5.0\Block Senders
0
 
LVL 1

Author Comment

by:tjeffryes
ID: 17873484
ch2:

Thanks very much.  In Outlook I seem to have well over 50 items in the blocked senders list.  While there is a key in my registry of the path you specified, the only 2 items under that key are:

(Default)
Version

(Default) has no value
Version has a value of 50000

There's nothing else there.  

That's on one machine.  On my laptop, I find HKEY_CURRENT_USER\Identities\{xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx\Software\Microsoft\Outlook Express\5.0\ but no "blocked Senders".


I probably should have been clearer in my posting.  This is definitely Outlook and not Outlook Express.

Also, interestingly, I just this mornign used the Office Setting migration wizard from my old machine to my new and the Blocked Senders list came over just fine.  Would be interesting to know how it was done.

Tim Jeffryes


0
 
LVL 11

Assisted Solution

by:ch2
ch2 earned 250 total points
ID: 17873628
Look here for Outlook:

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 1

Author Comment

by:tjeffryes
ID: 17874935
Hey, CH2:

Thanks again for the posting.  However, I got to that key and I find a ton of keys under \Outlook but nothing I can recognize as Blocked Senders.  Any idea?

Thanks again.

Tim
0
 
LVL 76

Accepted Solution

by:
David Lee earned 250 total points
ID: 17877361
Hi tjeffryes,

The blocked senders list is stored under the registry key ch2 gave.  On my system it's at the key listed below.  The blocked senders are stored in unicode format.  I don't know if the entire list is stored here or if the list might be spread across multiple keys if there are more than a certain number of entries.

HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\0a0d020000000000c000000000000046\001f041a


Cheers!
0
 
LVL 1

Author Comment

by:tjeffryes
ID: 17877434
Okay, guys.  Looks like you both pointed me in the right direction.  

BlueDevilFan, that key is the exact one I have and if I'm reading it right the first entry seems to match my first Blocked sender and the last entry seems to match my last blocked sender.

Now, a number of other questions:

1.  I have other questions that led from this, but in essence you have answered my original question.  So do I award now and create a new posting for my addtitional questions or can I ask them here?
2.  Since this is asynchronous, I'll ask now anyway and await the replies.
3. I'm not certain how to decode a binary registry entry in VBA.  Does it require a Windows API call if I'm not using .NET?  
4. In all my VBA work, I generally only retrieve string values from the regsitry or simple REG_DWORD values.  I really don't know how to decode the binary values.
5. Why would these registry keys be so cryptic and any idea as to whether I can rely on those keys to be found on other machines?

Tim

0
 
LVL 76

Expert Comment

by:David Lee
ID: 17877772
Hi, Tim.

In answer to your questions:

1.  Yes, you really should close this question and open an additional one for each question.  But since you've asked them here already ...
3 & 4.  No, it doesn't require a call to an API.  The following code will decode and display the contents of this registry key

Dim WshShell, arrValues, intIndex, varValue
Set WshShell = WScript.CreateObject("WScript.Shell")
arrValues = WshShell.RegRead("HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\0a0d020000000000c000000000000046\001f041a")
Set WshShell = Nothing
For intIndex = LBound(arrValues) To UBound(arrValues) Step 2
      varValue = varValue & Chr(arrValues(intIndex))
Next
arrValues = split(varValue, ";")
For intIndex = LBound(arrValues) To UBound(arrValues)
    Wscript.Echo arrValues(intIndex)
Next

5.  Good question.  Only Microsoft can answer that one.  You can definitely rely on the key down to Outlook existing.  I'm not sure about the portion of the key after Outlook (i.e. the one begining with 0a0d) beign the same.  I've searched and searched but have not been able to find any documentation on the Outlook profile.  
0
 
LVL 1

Author Comment

by:tjeffryes
ID: 17878402
BlueDevilFan:

You rock!  Thanks so much.

So here's what I'm doing.  I'm giving each of you 1/2 the points.  

Additionally, I've reposted the question regarding binary registry entries so that I can reward BlueDevilFan some more points.  So BlueDevilFan, please go to the link below and re-submit your answer and I'll award you more points.

Thanks to both of you!!!

Tim Jeffryes

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_22049870.html
0
 
LVL 1

Author Comment

by:tjeffryes
ID: 17884116
Just a follow-up comment:

the \Outlook\ portion of the registry key turns out to be the name of the current profile being used for outlook.  

So..... now i have to find code to find the current profile.

Tim
0
 
LVL 76

Expert Comment

by:David Lee
ID: 17888010
You're welcome, Tim.  I'm glad I was able to help out.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question