Results 1 to 6 of 6

Thread: [RESOLVED] email a document

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2009
    Location
    Townsville, Qld, Australia
    Posts
    135

    Resolved [RESOLVED] email a document

    I’ve got a sub-routine that e-mails a completed document automatically (if the user chooses that option). The code that I copied to do this uses the line
    Set myOutlook = Nothing
    when it has finished sending the e-mail. Can I delete this line because most users won’t want to close their Outlook? (The code uses a GetObject... / myOutlook.CreateItem method).
    Last edited by Resource Dragon; Jul 30th, 2010 at 05:46 AM. Reason: Add extra info that hopefully makes it easier for others to help me.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: email a document

    setting myoutlook to nothing does not actually close outlook, just disconnects from it
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2009
    Location
    Townsville, Qld, Australia
    Posts
    135

    Re: email a document

    So is the problem line

    myOutlook.Quit ?

    If so, can I delete it?

  4. #4
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: email a document

    Delete it and see if it fixes the problem. I don't know the Outlook object model, but that method sounds like one that will make Outlook go away.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: email a document

    just comment it out first to try

    but that is the instruction to close outlook
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jun 2009
    Location
    Townsville, Qld, Australia
    Posts
    135

    Re: email a document

    I tried it without "Outlook.Quit" today & it worked perfectly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width