I have a program that creates mail merges in word and emails them. This is the code that sends the emails:
VB Code:
Dim oApp As Object Dim oDoc As Object Dim str As String Set oApp = CreateObject("Word.Application") Set oDoc = oApp.Documents.Open(DocRec.FileLoc) With oDoc.MailMerge .OpenDataSource Name:=DataFileName .MailAsAttachment = False .MailAddressFieldName = "EmailAddress" '.MailSubject = TxtSubject.Text .Destination = wdSendToEmail .Execute End With oDoc.Close wdDoNotSaveChanges oApp.Quit
When the emails are sent outlook uses the "From address" from what is set up in outlook. Is there any way to change this in my code. Is there a property in Word I can change? Any ideas would be much appreciated.




Reply With Quote