Outlook 97 hangs after called from vba 
Author Message
 Outlook 97 hangs after called from vba

Hi everybody

I used an Access 97 application to send emails with Outlook 97. it
first run on win95 without problems.
Main codes lignes are
          Dim objOutlook As Outlook.Application
          Dim objOutlookMsg As Outlook.MailItem
          Dim objOutlookRecip As Outlook.Recipient
          Dim objOutlookAttach As Outlook.Attachment

          Set objOutlook = CreateObject("Outlook.Application")
          Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
          With objOutlookMsg
              Set objOutlookRecip = .Recipients.Add(sTo)
              objOutlookRecip.Type = olTo

              .Subject = sSubj
             .Body = sData
             For Each objOutlookRecip In .Recipients
                 objOutlookRecip.Resolve
             Next
          End With
          Set objOutlook = Nothing

These lignes work well with win95.

Recently we make a clean installation of Windows 98 on my PC. We have
now the following troubles:

emails are send with the VBA code using the Outlook object model
without problems but
1) the dll mapisp32 is not unload when the code is finished, which I
suspect is not correct.
2) when I open Outlook after vba calls, I cannot delete or received the
mails, Outlook hangs and I must kill it with ctrl alt + del.

I cannot correct that and I would appreciate any helps

Thanks
Francois R.

Sent via Deja.com
http://www.*-*-*.com/



Wed, 23 Jul 2003 00:10:36 GMT  
 Outlook 97 hangs after called from vba
try setting all of your dimmed objects to nothing after your function
executes
Quote:

> Hi everybody

> I used an Access 97 application to send emails with Outlook 97. it
> first run on win95 without problems.
> Main codes lignes are
>           Dim objOutlook As Outlook.Application
>           Dim objOutlookMsg As Outlook.MailItem
>           Dim objOutlookRecip As Outlook.Recipient
>           Dim objOutlookAttach As Outlook.Attachment

>           Set objOutlook = CreateObject("Outlook.Application")
>           Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
>           With objOutlookMsg
>               Set objOutlookRecip = .Recipients.Add(sTo)
>               objOutlookRecip.Type = olTo

>               .Subject = sSubj
>              .Body = sData
>              For Each objOutlookRecip In .Recipients
>                  objOutlookRecip.Resolve
>              Next
>           End With
>           Set objOutlook = Nothing

> These lignes work well with win95.

> Recently we make a clean installation of Windows 98 on my PC. We have
> now the following troubles:

> emails are send with the vba code using the Outlook object model
> without problems but
> 1) the dll mapisp32 is not unload when the code is finished, which I
> suspect is not correct.
> 2) when I open Outlook after vba calls, I cannot delete or received the
> mails, Outlook hangs and I must kill it with ctrl alt + del.

> I cannot correct that and I would appreciate any helps

> Thanks
> Francois R.

> Sent via Deja.com
> http://www.deja.com/



Sat, 26 Jul 2003 01:32:27 GMT  
 Outlook 97 hangs after called from vba
Hi Steve
You got it, setting objects reference to nothing does cure the problem
Thanks !
FR



Quote:
> try setting all of your dimmed objects to nothing after your function
> executes




Quote:
> > Hi everybody

> > I used an Access 97 application to send emails with Outlook 97. it
> > first run on win95 without problems.
> > Main codes lignes are
> >           Dim objOutlook As Outlook.Application
> >           Dim objOutlookMsg As Outlook.MailItem
> >           Dim objOutlookRecip As Outlook.Recipient
> >           Dim objOutlookAttach As Outlook.Attachment

> >           Set objOutlook = CreateObject("Outlook.Application")
> >           Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
> >           With objOutlookMsg
> >               Set objOutlookRecip = .Recipients.Add(sTo)
> >               objOutlookRecip.Type = olTo

> >               .Subject = sSubj
> >              .Body = sData
> >              For Each objOutlookRecip In .Recipients
> >                  objOutlookRecip.Resolve
> >              Next
> >           End With
> >           Set objOutlook = Nothing

> > These lignes work well with win95.

> > Recently we make a clean installation of Windows 98 on my PC. We
have
> > now the following troubles:

> > emails are send with the vba code using the Outlook object model
> > without problems but
> > 1) the dll mapisp32 is not unload when the code is finished, which I
> > suspect is not correct.
> > 2) when I open Outlook after vba calls, I cannot delete or received
the
> > mails, Outlook hangs and I must kill it with ctrl alt + del.

> > I cannot correct that and I would appreciate any helps

> > Thanks
> > Francois R.

> > Sent via Deja.com
> > http://www.deja.com/

Sent via Deja.com
http://www.deja.com/


Sun, 27 Jul 2003 23:07:16 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Automation seems to hang with Access 97 / Word 97

2. How can I send an Access report to Outlook 97 by VBA

3. How do you send Outlook 2000 email using WORD 97 VBA Macro

4. Does Outlook 97 use VBA?

5. Calling Outlook 97 users ???

6. Call a Word 97 Macro from Outlook 2000

7. Outlook 97 Vbscript-Calling Functions

8. Outlook 97 Vbscript-Calling Functions

9. VBA coding to call an Excel VBA macro from Outlook

10. Problem with Word 97 VBA Template called from form

11. Calling Access 97 reports from VB or VBA with parameters

12. Calling Access 97 reports from VB or VBA with parameters

 

 
Powered by phpBB® Forum Software