Here’s a little script written in Visual Basic to enumerate all your contacts in Microsoft Outlook 2003:
1
2
3
4
5
6
7
8
9
10
11
12
13
| Sub enum_update()
Dim namespace As namespace
Dim contacts As MAPIFolder
Dim contact As ContactItem
Set namespace = Application.GetNamespace("MAPI")
Set contacts = namespace.GetDefaultFolder(olFolderContacts)
For Each contact In contacts.Items
contact.LastName = contact.LastName
contact.Save
Next
End Sub |
If you import contacts from a personal folder file (.pst) the birthdays in all contacts won’t be updated in the calendar. Don’t worry, just run the VB script above. It simply simulates a change in each contact and saves it again
On the one hand Exchange’s RPC over HTTPS functionality is a cool feature if you wanna use Outlook behind a firewall which permits only a small range of ports (e.g. a public Internet connection). But otherwise the configuration of that technique could be the hell on earth
For example the certificate handling with IE7 (simply create a certificate on the Windows server and exactly import this one on the client machine). There’re lots of HOWTO’s on the Internet – my favourite among others is this one here.
So let’s assume that RPC over HTTPS works perfectly in your network. Among other quaint things it could happen that Outlook suddenly forgets your Exchange password. Although you clicked “Remember password” before, at once Outlook shows the login dialog while starting. Isn’t it funny?
The solution for that problem is to define a principal name for the certificate created on the Windows server. Just open the Exchange account settings on your client machine. Follow “More Settings”, “Connection” and “Exchange Proxy Settings”. At the upcoming dialog type your FQDN (including the “msstd:” prefix) as shown in the figure below. Now Outlook will keep your password – again.

Since parts of Java are Open Source, e.g. the Java compiler (javac), you can tap this home-made SUN tool to traverse the abstract syntax tree of any Java file by your own Visitor. Firstly, here are the code snippets for the tapping:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| // setup Context and FileManager
Context context = new Context();
JavacFileManager.preRegister(context);
// obtain FileManager and FileObject
JavacFileManager fileManager =
(JavacFileManager)context.get(JavaFileManager.class);
JavaFileObject fileObject =
fileManager.getFileForInput("samples/HelloWorld.java");
// create Scanner and Parser as soon as visit AST via MyVisitor
Scanner scanner = Scanner.Factory.instance(context)
.newScanner(fileObject.getCharContent(false));
Parser parser = Parser.Factory.instance(context)
.newParser(scanner, true, true);
parser.compilationUnit().accept(new MyVisitor()); |
And secondly here come the snippets for building your own visitor:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
| public class MyVisitor extends Visitor {
// visits the Top-Level-Element
public void visitTopLevel(JCCompilationUnit that) {
List list = that.getTypeDecls();
for ( JCTree typeDecl : list ) {
typeDecl.accept(this);
}
}
// visits the class definitions
public void visitClassDef(JCClassDecl that) {
System.out.println("Class = " + that.getSimpleName());
for ( JCTree member : that.getMembers() ) {
member.accept(this);
}
}
// visits the method definitions
public void visitMethodDef(JCMethodDecl that) {
System.out.println("Method = " + that.getName());
for ( JCVariableDecl param : that.getParameters() ) {
System.out.println("Parameter = " + param.getName());
}
}
// Are you looking for more overridings?
// Have a look at the members of class Visitor!
} |
All you have to do to is download and build the javac sources from www.java.net. Use the enclosed ANT script (build.xml) and you’ll get a jar-file (javac.jar). Just integrate it in your javac build path before compiling your program.