Code Query

  • Thread starter Thread starter JohnUK
  • Start date Start date
J

JohnUK

Can anyone let me know what these two lines do in a code?


Set OutMail = Nothing

Set OutApp = Nothing

Its just that I have a suspition its stopped my
send/receive in outlook
Many thanks in advance
John
 
Basically, it is clearing down the two object variables. Somewhere
previously the code will have set those objects, but if they are set to
nothing before you have finished, that is before the statement

OutMail.Send (or maybe OutMail.Display)

then you have a problem, if it comes after, that is not the problem.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
All that code does is remove all references from the variable. It i
used to free up memory and should not have anything to do with removin
your send/receive. Somewhere above these lines of code there wa
probably a line saying something like:

Set OutMail = CreateObject("SomeObject")

This deletes that reference.
 
I think it is more likely to be

Set OutMail = OutApp.CreateItem(olMailItem)

or

Set OutMail = OutApp.CreateItem(0)

--

HTH

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top