Csmith2303
New Member
- Joined
- Jun 28, 2017
- Messages
- 1
Hello and thank you for your interest.
I would like to do the following ... please don't be put off by the size of my post ... I am trying to supply as much information and explanation as I can, as briefly as I can.
When a cell is clicked, I would like it to create a new email using an Outlook message template which inserts the cell contents below into the beginning of the without overwriting the rest of the email template subject.
I currently have a spread sheet (IncNumbers) that has columns that contain relative details
I would like to have an option that state if I would like to assign this matter the the individual - this will then pull out all the information below into a template
A sample of the set out is as follows:
[TABLE="width: 1086"]
<tbody>[TR]
[TD]Activity / Lead Generator [/TD]
[TD]Lead Name [/TD]
[TD]Job Title [/TD]
[TD]Company[/TD]
[TD]Partner / Partners Responsible [/TD]
[TD]Notes [/TD]
[TD]Action Due date [/TD]
[/TR]
[TR]
[TD="align: left"]Test event 1 [/TD]
[TD="align: left"]Joe Blogs [/TD]
[TD="align: left"]Partner [/TD]
[TD="align: left"]Bloggs & Co [/TD]
[TD="align: left"]Claire [/TD]
[TD="align: left"]Please email with further information [/TD]
[TD]
False Pict [/TD]
[/TR]
</tbody><colgroup><col><col><col><col><col><col><col></colgroup>[/TABLE]
I have been using the code below and it works to an extent but cannot pull the dat into the body of the email
any help would be amazing
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
inc = Selection.Value
ans = MsgBox("Assign this action to partner(s)" & vbNewLine & vbNewLine & "Lead Name: " & inc, vbYesNo, "Correct Incident Number?")
If ans = vbNo Then
Exit Sub
Else
End If
Selection.Offset(0, 1).Value = Environ("UserName")
Dim objOut As Outlook.Application
Set objOut = CreateObject("Outlook.Application")
Set obJMailItem = objOut.CreateItem(olMailItem)
strEmailAddr = "Partners Email Pulled Here "
obJMailItem.Recipients.Add strEmailAddr
obJMailItem.Body = "Dear Partner X , you hve been assigned new activy in the business development pipeline document & vbNewLine & vbNewLine Lead Name: & vbNewLine& vbNewLine Lead Description & vbNewLine & vbNewLine Lead Due Date " 'Put the body in here, let me know if you need help with this
obJMailItem.Subject = inc & "-" & "You have a new business development activity"
obJMailItem.Display
Set obJMailItem = Nothing
Set objOut = Nothing
End Sub
many thanks
Chris
Kind regards,
TheShyButterflyHi All
I would like to do the following ... please don't be put off by the size of my post ... I am trying to supply as much information and explanation as I can, as briefly as I can.
When a cell is clicked, I would like it to create a new email using an Outlook message template which inserts the cell contents below into the beginning of the without overwriting the rest of the email template subject.
I currently have a spread sheet (IncNumbers) that has columns that contain relative details
I would like to have an option that state if I would like to assign this matter the the individual - this will then pull out all the information below into a template
A sample of the set out is as follows:
[TABLE="width: 1086"]
<tbody>[TR]
[TD]Activity / Lead Generator [/TD]
[TD]Lead Name [/TD]
[TD]Job Title [/TD]
[TD]Company[/TD]
[TD]Partner / Partners Responsible [/TD]
[TD]Notes [/TD]
[TD]Action Due date [/TD]
[/TR]
[TR]
[TD="align: left"]Test event 1 [/TD]
[TD="align: left"]Joe Blogs [/TD]
[TD="align: left"]Partner [/TD]
[TD="align: left"]Bloggs & Co [/TD]
[TD="align: left"]Claire [/TD]
[TD="align: left"]Please email with further information [/TD]
[TD]
[/TR]
</tbody><colgroup><col><col><col><col><col><col><col></colgroup>[/TABLE]
I have been using the code below and it works to an extent but cannot pull the dat into the body of the email
any help would be amazing
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
inc = Selection.Value
ans = MsgBox("Assign this action to partner(s)" & vbNewLine & vbNewLine & "Lead Name: " & inc, vbYesNo, "Correct Incident Number?")
If ans = vbNo Then
Exit Sub
Else
End If
Selection.Offset(0, 1).Value = Environ("UserName")
Dim objOut As Outlook.Application
Set objOut = CreateObject("Outlook.Application")
Set obJMailItem = objOut.CreateItem(olMailItem)
strEmailAddr = "Partners Email Pulled Here "
obJMailItem.Recipients.Add strEmailAddr
obJMailItem.Body = "Dear Partner X , you hve been assigned new activy in the business development pipeline document & vbNewLine & vbNewLine Lead Name: & vbNewLine& vbNewLine Lead Description & vbNewLine & vbNewLine Lead Due Date " 'Put the body in here, let me know if you need help with this
obJMailItem.Subject = inc & "-" & "You have a new business development activity"
obJMailItem.Display
Set obJMailItem = Nothing
Set objOut = Nothing
End Sub
many thanks
Chris
Kind regards,
TheShyButterflyHi All