У меня очень ограниченное знание VBA. У меня есть таблица с ведущими контактами. Я хочу установить раскрывающийся список, который отправляет электронное письмо определенному человеку, которого я выбрал, и затем возвращает контактную информацию в теле письма. Я не знаю, как получить электронную почту для автоматического заполнения, и прямо сейчас, появившееся письмо имеет «истину» в теле для контактной информации, а не возвращает текстовое значение в ячейке. Как и именно ГДЕ добавить код, чтобы исправить это?Выполнение задания Назначение электронной почты из таблицы Excel
Sub DropDown7_Change()
Dim answer As String
answer = MsgBox("Are you sure you want to assign this lead?", _
vbYesNo, "Send Email")
' Above code informs the user that an automated email will be sent
'Code uses the users answer to either carryout the generated email process or to not save the changes.
If answer = vbNo Then Cancel = True
If Cancel = True Then Exit Sub
If answer = vbYes Then
'Connects to outlook and retrieves information needed to create and send the email.
Set OutlookApp = CreateObject("Outlook.Application")
Set OlObjects = OutlookApp.GetNamespace("MAPI")
Set newmsg = OutlookApp.CreateItem(olMailItem)
'Contains the email address of the person receiving the email.
newmsg.Subject = "Lead Assigned to You" 'Sets the automated subject line to the email
newmsg.Body = "Hello," & vbNewLine & _
"You have been assigned a lead. Please follow up with the contact" & vbNewLine & _
ActiveCell.Offset(0, 3).Range("K5").Select
ActiveCell.Offset(0, 6).Range("K5").Select
ActiveCell.Offset(0, 7).Range("K5").Select
'Above code has the body of the automated email
newmsg.Display
End If
End Sub ' End of function