starsky
02-18-2010, 10:11 AM
Hello,
The code below is part of a set of procedures that allow me to quickly email workbooks from within Excel. At the moment it works perfectly when sending one attachment, i.e. an Outlook message is opened with relevant fields completed. I want to be able to send more than 1 file as attachments. The code below will place the filepath of the file to attach into A6, then the SendMessage function from CodeForExcelandOutlook uses that and information in other cells to populate the email.
The code below successfully places the filepaths of more than one file into A6, but this does not translate into the Outlook message. Any ideas? I've tried seperating two filepaths with ; and &, to no avail.
Sub Choosefile()
Dim fn
Dim Answer As String
Dim Qtn As String
fn = Application.GetOpenFilename
Range("A6") = fn
Qtn = "Would you like to choose another file?"
Answer = MsgBox(Qtn, vbQuestion + vbYesNo, "?")
If Answer = vbNo Then
Exit Sub
Else
fn = Application.GetOpenFilename
End If
Range("A6") = Range("A6").Value & " & " & fn
End Sub
Thanks.
The code below is part of a set of procedures that allow me to quickly email workbooks from within Excel. At the moment it works perfectly when sending one attachment, i.e. an Outlook message is opened with relevant fields completed. I want to be able to send more than 1 file as attachments. The code below will place the filepath of the file to attach into A6, then the SendMessage function from CodeForExcelandOutlook uses that and information in other cells to populate the email.
The code below successfully places the filepaths of more than one file into A6, but this does not translate into the Outlook message. Any ideas? I've tried seperating two filepaths with ; and &, to no avail.
Sub Choosefile()
Dim fn
Dim Answer As String
Dim Qtn As String
fn = Application.GetOpenFilename
Range("A6") = fn
Qtn = "Would you like to choose another file?"
Answer = MsgBox(Qtn, vbQuestion + vbYesNo, "?")
If Answer = vbNo Then
Exit Sub
Else
fn = Application.GetOpenFilename
End If
Range("A6") = Range("A6").Value & " & " & fn
End Sub
Thanks.