Results 1 to 7 of 7

Thread: Attaching File To e-Mail

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263

    Question

    Is there a way for me to create a button in my user form that after the file is saved when clicked attaches the file to an email?

    Thanks
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  2. #2
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    Assuming you are talking about a Word Macro and User Form, this is how you would attach an already saved file using a button on a user form:

    Code:
    Private Sub cmdSend_Click()
    AttachFile ActiveDocument.Path & Application.PathSeparator & ActiveDocument.Name
    End Sub
    
    Function AttachFile(tPath)
    Set out = CreateObject("outlook.application")
    Set myitem = out.CreateItem(0)
    myitem.Subject = tPath
    myitem.Body = "Here is the attachment you wanted."
    myitem.Attachments.Add tPath
    myitem.Display
    End Function
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    One problem. I am using Novell Groupwise... Is there a way I can do it with that?
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  4. #4
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    I don't have any experience with Novell Groupwise. I'm not sure... Maybe create a MAPI session and work through it that way, but like I said, I don't know anything about Novell Groupwise. Try search the web - altavista might be your best bet.
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    I have this code to send an attach this worksheet. It WORKS, but, how can i send to multiple recipients instead of just one. Here is the code I have
    Code:
    Private Sub btnmail_Click()
    ActiveWorkbook.SendMail Recipients:="[email protected]"
    
    End Sub
    How can I add one more person to the recipient. Even better, how can I add Carbon Copy (CC) to it instead.

    Thanks
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  6. #6
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    Not sure about the CC field. Maybe just CC:="whatever". I doubt it though. But in the "To:" line you should be able to insert multiple addresses by seperating them with a semicolon (. Hope this helps.
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    We tried that but, I figured this out

    Code:
    ActiveWorkbook.SendMail Recipients:=(range("A1:A2")
    Thanx Anyway
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

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