Education and Work
Location: Leeds, United Kingdom
Recently I was faced with a windows XP service pack 2 PC running internet explorer 7, with microsoft office 2000 on. All service packs were up to date.
Microsoft Outlook was unable to display HTML e-mails, and both system restore and windows search open blank, apart from the toolbar on the left hand side which includes the ‘dog’ desktop helper.
I had tried removing internet explorer version 7, all the way back to internet exlporer 5. This made no difference. I then tried reinstalling XP Service Pack 3, but to no avail.
We had 2 seperate devices with the same issue on the network, one a laptop the other was a desktop.
After many hours of head scratching and googling.. I managed to find a solution!!
You can download IEFix from here
With this example, it’s possible to use the ‘WithEvents’ methods on a folder outside of your own mailbox.
This even works on Public Folders!
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 29 30 31 32 33 34 35 36 37 38 39 | Dim WithEvents olkFolder As Outlook.MAPIFolder Sub InitMonitoring() Set olkFolder = OpenOutlookFolder("Path to the folder to monitor") End Sub Function IsNothing(obj) If TypeName(obj) = "Nothing" Then IsNothing = True Else IsNothing = False End If End Function Function OpenOutlookFolder(strFolderPath As String) As Outlook.MAPIFolder Dim arrFolders As Variant, _ varFolder As Variant, _ olkFolder As Outlook.MAPIFolder On Error GoTo ehOpenOutlookFolder If strFolderPath = "" Then Set OpenOutlookFolder = Nothing Else If Left(strFolderPath, 1) = "" Then strFolderPath = Right(strFolderPath, Len(strFolderPath) - 1) End If arrFolders = Split(strFolderPath, "") For Each varFolder In arrFolders If IsNothing(olkFolder) Then Set olkFolder = Session.Folders(varFolder) Else Set olkFolder = olkFolder.Folders(varFolder) End If Next Set OpenOutlookFolder = olkFolder End If On Error GoTo 0 Exit Function ehOpenOutlookFolder: Set OpenOutlookFolder = Nothing On Error GoTo 0 End Function |
Simply copying fonts into the fonts folder using a VB script doesn’t actually install them.
To install the fonts you have to use the following code:
1 2 3 4 | Const FONTS = &H14& Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(FONTS) objFolder.CopyHere "C:ScriptsMyfont.ttf" |
Outlook 2007 brought with it the all new ‘Ribbon Bar’ which has caused headaches to programmers the world over.
Now, using this code you can create a menu in Outlook. The menu, which contains one item, appears at the top of the application. When you click the menu item, the code displays a message that shows the menu item caption.
Private Sub ThisApplication_Startup(ByVal sender As Object, ByVal e _
As System.EventArgs) Handles Me.Startup
RemoveMenubar()
AddMenuBar()
End Sub
Private Sub AddMenuBar()
Try
menuBar = Me.Application.ActiveExplorer().CommandBars.ActiveMenuBar
newMenuBar = menuBar.Controls.Add( _
Office.MsoControlType.msoControlPopup, _
Temporary:=False)
If newMenuBar IsNot Nothing Then
newMenuBar.Caption = “New Menu”
newMenuBar.Tag = menuTag
buttonOne = newMenuBar.Controls.Add( _
Office.MsoControlType.msoControlButton, _
Before:=1, Temporary:=True)
With buttonOne
.Style = Office.MsoButtonStyle.msoButtonIconAndCaption
.Caption = “Button One”
.FaceId = 65
.Tag = “c123″
End With
AddHandler buttonOne.Click, AddressOf ButtonOne_Click
newMenuBar.Visible = True
End If
Catch Ex As Exception
MessageBox.Show(Ex.Message)
End Try
End Sub
Public Sub ButtonOne_Click(ByVal buttonControl As Office. _
CommandBarButton, ByRef Cancel As Boolean)
MessageBox.Show(“You clicked: ” & buttonControl.Caption, _
“Custom Menu”, MessageBoxButtons.OK)
End Sub
Private Sub RemoveMenubar()
Try
‘ If the menu already exists, remove it.
Dim foundMenu As Office.CommandBarPopup = _
Me.Application.ActiveExplorer().CommandBars.ActiveMenuBar. _
FindControl(Office.MsoControlType.msoControlPopup, _
System.Type.Missing, menuTag, True, True)
If foundMenu IsNot Nothing Then
foundMenu.Delete(True)
End If
Catch Ex As Exception
MessageBox.Show(Ex.Message)
End Try
End Sub











