View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ralph Ralph is offline
external usenet poster
 
Posts: 79
Default Sending an email with Excel macro

I am using the following code to send an email but I still have to click the
Send button. How do I automate this?

'Send by email the txt work file
Workbooks.OpenText Filename:=PCODir & PCOFil, Origin:=xlMSDOS,
StartRow:=1, _
DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1)),
TrailingMinusNumbers:=True
Application.CutCopyMode = False
Application.Dialogs(xlDialogSendMail).Show Emailto, "Pick-confirm
file attached"
ActiveWorkbook.Close