I have written a Word macro which, when it has run emails me with a number (my email system is Lotus Notes). The code I have used is:- Dim...

How It Works

Get an answer in three easy steps. Here's how it works...

Ask Your Question

1. Ask Your Question

Enter your programming question at the top of this page and click Get An Answer.

Pick Your Priority

2. Pick Your Priority

Tell us how quickly you want your programming question answered.

Get An Answer

3. Get An Answer

Connect with your programmer via online chat or telephone call.

Answer

Customer
I have written a Word macro which, when it has run emails me with a number (my email system is Lotus Notes). The code I have used is:- Dim session As Object Dim db As Object Dim doc As Object Set session = CreateObject(NOTES.SESSTION) Set db = session.CURRENTDATABASE() Set doc = db.CREATEDOCUMENT() doc.Form = "Memo" doc.Subject = "Purchase Order Numbers" doc.Body = "The number just used is " & Rng1.Text & "." Call doc.Send(False, "ADenyer") All runs fine the first 2 or 3 times, then I get "run time error 91 - Object variable or With block variable not set" and the 'Set doc = db.CREATEDOCUMENT()' lines is highlighted. If I close down Lotus Notes and reopen it all is fine for a while, then I hit the same problem. Is this a quirk of Lotus? Is there a way to stop it happening?
Posted

quoteTestimonialsquote

About ExpertHelp

ExpertHelp is changing the way you connect with service professionals.

Whether you have a quick question while preparing your taxes, troubleshooting a computer problem, or need to hire an attorney, ExpertHelp is the most convenient and affordable way to connect with the right service professional to get the job done.

ExpertHelp has been in business since 2011, is an A+ Rated Better Business Bureau accredited member, and offers a 100% satisfaction guarantee on every question you ask!

More Programming Questions...

Ask Your Programming Question & Get An Answer Now!