Hi Dan,On 2002-05-31 05:16, dk wrote:
Now How cant i add a attachement file in the macro
You can add attachments. Use this line before you send it:-
olMail.Attachments.Add "C:Your folderYour File.xls"
HTH,
Dan
Hi Dan,On 2002-09-11 02:14, dk wrote:
Hi Verluc,
I'm not sure about this. When I send an email (using Outlook XP) the attachment always appears in the same place (in a separate bar just below the subject line).
A few questions:-
Which version of Outlook are you using?
When you run the macro what sort of message is created i.e. HTML, plain text, RTF?
Is the type of message created different from the type you create when manually attaching a file?
Hi,
Try this code.. .. ..
Let me know if this suits your needs,Code:Sub Test() Dim olApp As Object, olMail As Object Set olApp = CreateObject("Outlook.Application") Set olMail = olApp.CreateItem(0) olMail.To = "Anyone@anywhere.com" olMail.Body = Range("a1") 'Change to suit your needs 'To display the message use this olMail.Display 'or to send the message use this 'olMail.Send 'Reactive Excel AppActivate "Microsoft Excel" End Sub
Dan
olMail.Body = Range("a1:a50")
MyVar = Range ("a1")
Myvar = Myva + Ranger ("a2")
Myvar = Myvar + Range ("a3")
...etc. ...etc. ...etc. up to a50
...
similar to above code except for
...
olMail.Body = Myvar
Sub Test()
Dim olApp As Object, olMail As Object
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(0)
Dim emails As Integer
emails = 1
Do While emails < 85' put the number of cells that you have filled with email adresses
olMail.To = olMail.To + ";" + Range("a" & emails) 'Change to suit your needs
emails = emails + 1
Loop
'To display the message use this
olMail.Display
'or to send the message use this
'olMail.Send
'Reactive Excel
'AppActivate "Microsoft Excel"
End Sub