blgsai
Wed Nov 17 13:29:07 CST 2004
Thank You - that worked. I know I tried it but I must have missed something
because it now works using early binding. I really appreciate it. Thx.
"Jean-Guy Marcil" wrote:
> blgsai was telling us:
> blgsai nous racontait que :
>
> > It fails at Line 1 and if I comment out Lines 1, 2 and 4 and leave
> > just line 3, it still fails at line 3.
> > 1: Set myOutlook = GetObject(, "Outlook.Application")
> >
> > 2: If myOutlook Is Nothing Then
> > 3: Set myOutlook = CreateObject("Outlook.Application")
> > 4: End If
> >
> > I made sure to check that the project has the references and I have
> > the following references:
> > - Visual Basic for Applications
> > - Microsoft Word 9.0 Object Library
> > - OLE Automation
> > - Microsoft Office 9.0 Object Library
> > - Microsoft Outlook 11.0 Object Library
> > - Microsoft Forms 2.0 Object Library
> >
> Have you tried changing
>
> Dim myOutlook As Object
> Dim myInspector As Object
>
> to
>
> Dim myOutlook As Outlook.Application
> Dim myInspector As Outlook.Inspector
>
> I think it is better to use explicit assignments whenever you can.
> Maybe your code was working under Word/Outlook 2000 because the compiler
> correctly guessed what kind of object myOutlook was.
> Now that you are using an Outlook version that is different from the Word
> one, maybe the compiler cannot guess anymore.
>
> It may be an Ealry vs Late binding issue.
> Normally, we use
> Dim myOutlook As Object
> in late binding, but you use early binding...
>
> See
>
http://word.mvps.org/faqs/interdev/EarlyvsLateBinding.htm
> for more on the pros/cons of Early/Late binding.
>
> If not, have you tried posting in an Outlook group?
>
> --
> Salut!
> _______________________________________
> Jean-Guy Marcil - Word MVP
> jmarcilREMOVE@CAPSsympatico.caTHISTOO
> Word MVP site:
http://www.word.mvps.org
>
>
>
>