S
Sean
I am trying to send a document with a pre-written message
in the body. It also should include values of
DocumentProperties in the document. When the macro runs
the Document Properties are changed and set, however, I
cannot get them to be placed within the body of the
email. The email will generate and send, but the Subject
and the Body of the email will not take the DocProperty
references and generates the lines with blanks in them
where the DocProperty.Value should be. I included part of
the code where the email is written below. Is something
wrong with it.
With oItem
.To = ActiveDocument.CustomDocumentProperties
("ManagerEmail").Value
.Subject = "Associate Consultant Weekly Activity Log -
Week Ending " & ActiveDocument.CustomDocumentProperties
("WeekEndingDate").Value & " - " &
ActiveDocument.CustomDocumentProperties
("ConsultantName").Value
'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:="Document as attachment"
.Body = "Hi " &
ActiveDocument.CustomDocumentProperties
("ManagerName").Value & "," & vbCrLf & vbCrLf & "Here is
my weekly activity log for week ending " &
ActiveDocument.CustomDocumentProperties
("WeekEndingDate").Value & " ." & vbCrLf _
& "Please let me know if you have any questions."
& vbCrLf & vbCrLf &
ActiveDocument.CustomDocumentProperties
("ConsultantName").Value
.Send
End With
in the body. It also should include values of
DocumentProperties in the document. When the macro runs
the Document Properties are changed and set, however, I
cannot get them to be placed within the body of the
email. The email will generate and send, but the Subject
and the Body of the email will not take the DocProperty
references and generates the lines with blanks in them
where the DocProperty.Value should be. I included part of
the code where the email is written below. Is something
wrong with it.
With oItem
.To = ActiveDocument.CustomDocumentProperties
("ManagerEmail").Value
.Subject = "Associate Consultant Weekly Activity Log -
Week Ending " & ActiveDocument.CustomDocumentProperties
("WeekEndingDate").Value & " - " &
ActiveDocument.CustomDocumentProperties
("ConsultantName").Value
'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:="Document as attachment"
.Body = "Hi " &
ActiveDocument.CustomDocumentProperties
("ManagerName").Value & "," & vbCrLf & vbCrLf & "Here is
my weekly activity log for week ending " &
ActiveDocument.CustomDocumentProperties
("WeekEndingDate").Value & " ." & vbCrLf _
& "Please let me know if you have any questions."
& vbCrLf & vbCrLf &
ActiveDocument.CustomDocumentProperties
("ConsultantName").Value
.Send
End With