ARA - How do I e-mail an excel based Invoice??
ARA - How  do I e-mail an excel based Invoice??
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 7 of 7

Thread: ARA - How do I e-mail an excel based Invoice??

  1. #1
    New Member
    Join Date
    Feb 2002
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Hi All
    I work for an International freight forwarding company and we have Outlook and Outlook Express installed. To save printing out the invoice and faxing it I would like to e-mail it directly from my PC to the client as so many now have internet access.

    Is it possible ???!!!

    If so HOW??

    Your help much appreciated

    Regards

    Peter

  2. #2
    MrExcel MVP Anne Troy's Avatar
    Join Date
    Feb 2002
    Location
    Westwood NJ
    Posts
    2,581
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Save your file, then.

    Believe it or not, there's a little envelope icon on your toolbar.

    Also, File-Send to-Email recipient. And may I strongly suggest you always send as an attachment?

    ~Anne Troy

  3. #3
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Christchurch New Zealand
    Posts
    1,030
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try

    Sub SendEmail()

    Dim aOutlook As Outlook.Application, aEmail As Outlook.MailItem

    On Error Resume Next

    Set aOutlook = GetObject(, "Outlook.Application")

    If aOutlook Is Nothing Then Set aOutlook = New Outlook.Application

    On Error GoTo 0

    If aOutlook Is Nothing Then

    MsgBox "Microsoft Outlook is not installed."

    Else

    Set aEmail = aOutlook.CreateItem(olMailItem)

    aEmail.Subject = "Latest figures"

    aEmail.Body = "The figures do not include the last two days of trading."

    aEmail.Attachments.Add ThisWorkbook.Path & "data01.xls"

    aEmail.Recipients.Add "email@address.com"

    On Error GoTo lNoSend

    aEmail.Send

    MsgBox "Email successfully sent."

    End If

    Exit Sub

    lNoSend:

    MsgBox "Email not sent."

    End Sub
    or

    Sub SendEmailNR()

    Dim aOutlook As Object, aEmail As Object

    On Error Resume Next

    Set aOutlook = GetObject(, "Outlook.Application")

    On Error GoTo lNoOutlook

    If aOutlook Is Nothing Then Set aOutlook = CreateObject("Outlook.Application")

    Set aEmail = aOutlook.CreateItem(olMailItem)

    On Error GoTo 0

    aEmail.Subject = "Latest figures"

    aEmail.Body = "The figures do not include the last two days of trading."

    aEmail.Attachments.Add ThisWorkbook.Path & "data01.xls"

    On Error GoTo lNoSend

    aEmail.Recipients.Add "bigman@hotmail.com"

    aEmail.Send

    MsgBox "Email successfully sent."

    Exit Sub

    lNoSend:

    MsgBox "Email not sent."

    Exit Sub

    lNoOutlook:

    MsgBox "Microsoft Outlook is not installed."

    End Sub


    [ This Message was edited by: brettvba on 2002-03-11 16:35 ]

  4. #4
    Guest

    Default

    ic

  5. #5
    Board Regular
    Join Date
    Mar 2002
    Posts
    122
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    i tried this and it doesnt work!?

  6. #6
    Board Regular
    Join Date
    Feb 2002
    Location
    Jefferson City, Missouri
    Posts
    382
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    With your invoice open click on the visual basic editor or alt+f11. Highlight your project and click insert>module, then paste this code:

    Sub SendIt()
    Application.Dialogs(xlDialogSendMail).Show _
    arg1:="email@address.com", _
    arg2:="Invoice name"
    End Sub

    (arg1 will be the default address, when outlook opens you can change who receives the invoice.)

    Then close the editor and on your invoice add a command button and set its caption to "Click to send invoice".

    Right click on the command button and click view code. Then paste this code:

    Dim Pw As String

    Pw = InputBox("Enter Password")
    If Pw = "Whatever you want as password" then SendIt:End
    If Pw <> "Your password above" Then
    MsgBox ("Incorrect Password, cannot send mail")
    End If

    The above code will prevent others from sending the invoice without your knowledge.
    (Just make sure to right click on your project file, click on vbaproject properties,and enter a password under the protection so others cannot view your code.

    Save your workbook and click the button.


    HTH

    Viper

  7. #7
    Board Regular
    Join Date
    Feb 2002
    Location
    Jefferson City, Missouri
    Posts
    382
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Sorry,

    Make sure to enter the command button code in the click_event.


User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com