Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 26th, 2006, 06:30 AM
Registered User
Join Date: Oct 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default E-Mail Attachments

How do I set up a macro that will attach a workbook to an e-mail without sending it automatticly

I use the following to send e-mail auto for me;

Sub EMail_Workbook_SCM()

If MsgBox("Click OK to send report", vbOKCancel, _
    "You are about to send this report to Supply Class Management") = vbCancel Then Exit Sub

    Dim wb1 As Workbook
    Dim wb2 As Workbook
    Dim wbname As String
    Application.ScreenUpdating = False
    Set wb1 = ActiveWorkbook
    wbname = "C:/" & wb1.Name & " " & _
    Format(Now, "dd-mm-yy") & ".xls"
    wb1.SaveCopyAs Filename:=wbname
    Set wb2 = Workbooks.Open(wbname)
    With wb2
        .SendMail "KBR.lc3.DOLSupCM@kbr.com"
        .ChangeFileAccess xlReadOnly
        Kill .FullName
        .Close False
    End With
    Application.ScreenUpdating = True
End Sub

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Send mail and attachments with PHP mail function Lofa Beginning PHP 1 June 2nd, 2008 03:24 PM
Mail with Attachments software_developer_kk Classic ASP Basics 1 March 31st, 2005 12:34 AM

All times are GMT -4. The time now is 04:10 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.