I have a program that creates mail merges in word and emails them. This is the code that sends the emails:


VB Code:
  1. Dim oApp As Object
  2.     Dim oDoc As Object
  3.     Dim str As String
  4.                
  5.     Set oApp = CreateObject("Word.Application")
  6.     Set oDoc = oApp.Documents.Open(DocRec.FileLoc)
  7.    
  8.     With oDoc.MailMerge
  9.        
  10.         .OpenDataSource Name:=DataFileName
  11.         .MailAsAttachment = False
  12.         .MailAddressFieldName = "EmailAddress"
  13.         '.MailSubject = TxtSubject.Text
  14.         .Destination = wdSendToEmail
  15.         .Execute
  16.        
  17.     End With
  18.    
  19.     oDoc.Close wdDoNotSaveChanges
  20.     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.