Creating Navigation boxes through a macro

Tempus

Board Regular
Joined
May 11, 2006
Messages
56
I am have created a form in excel along with a Macro that emails it as an attachment, to variable people. what I need is how to make it so people can attach other files to the email as well, and this has to be done all through excel.
here's what I have currently
Code:
 EmailSend Macro
' Sending Email
'
        
        
   
    
    Dim OutApp As Outlook.Application
    Dim OutMail As Outlook.MailItem
    Dim RecipName1 As String
    Dim RecipName2 As String
    Dim RecipName3 As String
    RecipName1 = ThisWorkbook.Worksheets("New").Range("B8").Value
    RecipName2 = ThisWorkbook.Worksheets("New").Range("B10").Value
    RecipName3 = ThisWorkbook.Worksheets("New").Range("B11").Value
    
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(olMailItem)
    ChDir "C:\WINNT"  'Change this line to tell it where to save
         'This line tells it what to save as
         ActiveWorkbook.SaveAs "New_Plat_Cust_Form" & ".xls"
    With OutMail
        .To = "US_Platinum_Program_Office"
        .CC = RecipName2
        .BCC = ""
        .Subject = RecipName3
        .Body = "This is an automatically generated New Platinum Customer Form  "
        .Attachments.Add ThisWorkbook.FullName
        
        'You can add other files also like this
        '.Attachments.Add ("C:\test.txt")
        
        .Send   'or use .Display
    End With
    Set OutMail = Nothing
    Set OutApp = Nothing

'
End Sub

I thought about using links in the attachment, but they will need to be able to select where the attachments are coming from just like any other "normal" email attachment options.
Can anyone help with this, I'm stumped.


oh and I blatanly stole and twisted ron debruins EmailSend macro. so if there are any errors they are mine and not his.


thanks,
Tempus
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

sunnyland

Well-known Member
Joined
Jan 27, 2006
Messages
912
Hello try this:


'You can add other files also like this
Dim myfiles As Variant
myfiles = Application.GetOpenFilename(, , "Please select other file(s) to attach", , True)

If IsArray(myfiles) Then
For x = 1 To UBound(myfiles)
.Attachments.Add myfiles(x)
Next
End If
 

Forum statistics

Threads
1,141,011
Messages
5,703,723
Members
421,311
Latest member
tanujath

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top