Hi,
I need to add an email-shot function to our MS Access DB, I can automate all this no problem, create the mailmerge template, do all the VB coding to automate this with a datasource etc..
However, normally this would automatically send through the users outlook that is loggen on at the time, no probs.
However, they want me to create a sepcific email address for this mailing campaign and then send via that email addy.
Now creating the mailbox and giving people 'send on behalf' privilages is not a problem, but how do you tell the mailmerge via the VBcode to use xyz@mydomain.com as the senders email address (ie. send on behalf of).
Here is the code I have so far...
so does anyone know where in the 'With' operation I can issue the OnBehalfOf email address?
Is this even possible?
Also I need to put a dynamic Hyperlink in the document, but I don't seem to be able to use the insert hyperlink and then include mergefields in the url.
how would you do this?
cheers, 1DMF.
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
I need to add an email-shot function to our MS Access DB, I can automate all this no problem, create the mailmerge template, do all the VB coding to automate this with a datasource etc..
However, normally this would automatically send through the users outlook that is loggen on at the time, no probs.
However, they want me to create a sepcific email address for this mailing campaign and then send via that email addy.
Now creating the mailbox and giving people 'send on behalf' privilages is not a problem, but how do you tell the mailmerge via the VBcode to use xyz@mydomain.com as the senders email address (ie. send on behalf of).
Here is the code I have so far...
Code:
Set wordApp = CreateObject("Word.Application")
'Open document
wordApp.Documents.Open sFile
'issue emailmerge commands
With wordApp.ActiveDocument.MailMerge
.MainDocumentType = wdEMail
.OpenDataSource Name:=cDrive & "\mypath\mydatasource.xls", _
ReadOnly:=True, Connection:=sTable, SubType:=wdMergeSubTypeWord, _
SQLStatement:="Select * From [" & sTable & "]"
.Destination = wdSendToEmail
.MailSubject = sSubject
.Execute
End With
so does anyone know where in the 'With' operation I can issue the OnBehalfOf email address?
Is this even possible?
Also I need to put a dynamic Hyperlink in the document, but I don't seem to be able to use the insert hyperlink and then include mergefields in the url.
how would you do this?
cheers, 1DMF.
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!