PDA

View Full Version : Open excel file when outlook starts up



wilg
04-09-2011, 07:33 AM
Hi, trying to open a specified excel file in a w:// drive when I first start outlook.
Any suggestions?

dicepackage
04-11-2011, 10:48 AM
Try inserting this code in Outlook


Private Sub Application_Startup()
Dim filename As String
Dim RetVal
Dim fs
filename = "C:\file.xls"
Set fs = CreateObject("Scripting.FileSystemObject")
If (fs.FileExists(filename)) Then
Shell "cmd.exe /c Start ""Tiff"" """ & filename & """"
Else
MsgBox ("File not found")
End If
End Sub