Hi, I'm stuck and i am needing help.
i have created a message template to be used for admin, but they want their lives made easier. Now the boss has asked me to sort it out.
Basically, the issue is this. Below is an image of the template. It was created in a table. at the moment the admin are filling in all fields themselves. Now they want some fields filled in automatically. The fields they want auto-filled are :
Date created: - Populates the date that the message was created.
ATTACHED FOR REFERENCE - This is a list of all of the attachments that have been attached to the email.
FILE PATH STRUCTURE ON SERVER - This is a list of the location where the attachments were inserted from. ( eg c:/jobs/5467/pdfs/drawing0042.pdf )
I have found some code from other places that help me to some point with the 1st field and 2nd field but not the 3rd field.
1st field - the code works (from Diana - thanks) but i need it to be in the correct cell.
2nd field - this also needs to be in the correct cell, and also i cant seam to create a custom form button to run this script (would be nice if it was one button for all )
3rd field - Total loss - i need the code and button (again if was same button would be fab)
Cheers
GingaDave
i have created a message template to be used for admin, but they want their lives made easier. Now the boss has asked me to sort it out.
Basically, the issue is this. Below is an image of the template. It was created in a table. at the moment the admin are filling in all fields themselves. Now they want some fields filled in automatically. The fields they want auto-filled are :
Date created: - Populates the date that the message was created.
ATTACHED FOR REFERENCE - This is a list of all of the attachments that have been attached to the email.
FILE PATH STRUCTURE ON SERVER - This is a list of the location where the attachments were inserted from. ( eg c:/jobs/5467/pdfs/drawing0042.pdf )
I have found some code from other places that help me to some point with the 1st field and 2nd field but not the 3rd field.
1st field - the code works (from Diana - thanks) but i need it to be in the correct cell.
Code:
Sub StampDate()
Item.DTS1 = Now()
End Sub
Sub InsertDate_Click()
Call StampDate()
End Sub
2nd field - this also needs to be in the correct cell, and also i cant seam to create a custom form button to run this script (would be nice if it was one button for all )
Code:
Sub Names()
Dim Atmt As Attachment
Dim Mensaje As Outlook.MailItem
Dim Adjuntos As String
Dim Body As String
Dim i As Integer
Set Mensaje = Application.ActiveInspector.CurrentItem
Mensaje.BodyFormat = olFormatHTML
Body = Mensaje.HTMLBody
i = 0
Adjuntos = ""
For Each Atmt In Mensaje.Attachments
'If Atmt.Size > 5 Then
Adjuntos = Adjuntos & "** Attached file: <u> " & Atmt.FileName & " </u> <br>"
i = i + 1
'End If
Next Atmt
Adjuntos = "<u> <b> Total number of attached files: " & i & "</u></b> <br>" & Adjuntos
Mensaje.HTMLBody = Left(Body, InStr(Body, "</body>") - 1) & Adjuntos & Right(Body, Len(Body) - InStr(Body, "</body>") + 4) & Format(Now)
Set Mensaje = Nothing
3rd field - Total loss - i need the code and button (again if was same button would be fab)
Cheers
GingaDave