Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sending from Listbox

Status
Not open for further replies.

iainIOW

Technical User
Apr 4, 2003
6
IN
hi i have a bit of code that sends a saved file via outlook as an attachment,
the user opens the word document, fills in the user form i have created, presses an "ok" button, and then the document is saved as a delimited text file and then the saved file is e-mailed. this is a bit of code i am having trouble with ---
With oItem
.To =
.Subject = "New Contract Notification"
'Add the document as an attachment, you can use the .displayname property
'to set the description that's used in the message
.Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue, _
DisplayName:="Notification of new contract for the Contract Register"
.Send
End With

This is the bit of code that instructs outlook how and where to send the e-mail (from word). i wish to use the value of a list box - i.e. listbox1 as the parameter for ".To" - but if is simply as .To Listbox1 , the e-mail does not send! is there something i am doing wrong? is this possible?

Many thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top