Vba - Opening Outlook with Vba

  • Thread starter Thread starter ajliaks
  • Start date Start date
A

ajliaks

Hi all,

I am keep trying to generate an MS Outlook Task from Excel Vba.
I thought I can first open Outlook, and then trying to generate task o
note.
First of all, could anybody help me with the first step, opening M
Outlook?

Iam trying this code unsuccessfuly: (I use Outlook 03 with Xp prof)


Private Sub OpeningOutlook()
Dim OutLk As Application
Dim B As String

B = "C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE"
Set Out = GetObject(B)
OutLk.Application.Open

OutLk.Application.Visible = True
'Here generating task or note
OutLk.Parent.Windows(1).Visible = True
OutLk.Application.Quit
End Sub


Thank you all!
Aldo
 
Dim olApp as Object

On Error Resume Next
Set olApp = GetObject(,"Outlook.Application")
If olApp Is Nothing Then
Set olApp = CreateObject("Outlook.Application")
End If

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top