Advertisement
Guest User

Untitled

a guest
Feb 21st, 2018
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.77 KB | None | 0 0
  1. Private Sub Command1_Click()
  2.  
  3. Dim AlApp As Object
  4. Dim objmail As Object, signature As String
  5.  
  6. On Error Resume Next
  7.  
  8.  
  9. Set olApp = GetObject(, "Outlook.Application") 'Outlook needs to be open.
  10. If Err Then 'If outlook is not open.
  11. Set olApp = CreateObject("Outlook.Application") 'Create a new instance of outlook.
  12. End If
  13.  
  14. Set objmail = olApp.CreateItem(0)
  15. Dim email_body As String
  16.  
  17.  
  18. email_body = email_body & "<span style=""font-size: 11pt""><font face=Calibri+Body>Dear," & "<br>" & "<br>"
  19. email_body = email_body & "We note from our records that it has been almost 12 months since your equipment was last calibrated." & "<br>" & "<br>"
  20. email_body = email_body & "Please see details below. " & "<br>" & "<br>"
  21.  
  22. 'TABLE
  23.  
  24. email_body = email_body & "TABLE" & "<br>"
  25. email_body = email_body & "TABLE" & "<br>"
  26. email_body = email_body & "TABLE" & "<br>" & "<br>"
  27.  
  28. 'TABLE
  29.  
  30.  
  31. email_body = email_body & "It is crucial that instruments are serviced and calibrated regularly to ensure sufficient accuracy for their professional use. A maximum time between laboratory calibrations is specified in standards, monitoring protocols and quality management systems." & "<br>" & "<br>"
  32. email_body = email_body & "<ul><li>&nbsp;&nbsp;&nbsp;If you wish to <b>proceed with the calibration</b>, please let me know and we will be happy to provide you with a price for calibration, services available and delivery options. </ul></li> "
  33. email_body = email_body & "<ul>Just call ANV Measurement Systems <b>(01908 642 846) to book your calibration, then:</ul></b>"
  34. email_body = email_body & "<ul>-&nbsp;&nbsp;&nbsp;&nbsp; Send or bring your equipment to us with a purchase order</ul>"
  35. email_body = email_body & "<ul>-&nbsp;&nbsp;&nbsp;&nbsp; Or ask us to collect the instruments from your location</ul>" & "<br>"
  36. email_body = email_body & "<ul><b>Alternatively</b></ul> "
  37. email_body = email_body & "<ul><li>&nbsp;&nbsp;&nbsp;Visit our website to <b>book your calibration</b> online <b><a href=http://www.noise-and-vibration.co.uk/><span style=""color: MidnightBlue"">www.noise-and-vibration.co.uk</span></b></a></ul></li>" & "<br>"
  38. email_body = email_body & "Here at ANV Measurement Systems we are able to offer calibration support on a huge range of acoustic and vibration equipment <b>(UKAS accredited laboratory No 0653)</b>." & "<br>" & "<br>"
  39. email_body = email_body & "<b>We provide a quick turnaround service for your calibration needs, normally 5 working days.</b>" & "<br>" & "<br>" & "<br>"
  40. email_body = email_body & "<b><em><span style=""color: MidnightBlue"">Don't miss out on the fantastic Extended Warranty Offer (up to 6 years) when you have your Rion instrumentation calibrated annually (or in accordance with UKAS Publication Lab 23) by ANV Measurement Systems.</em></span>" & "<br>" & "<br>"
  41. email_body = email_body & "<span style=""color: MidnightBlue""><b>If you can't afford to be without your instrumentation during a repair or calibration, we can also offer equipment hire at a reduced rate.</b></span></font></b></span>" & "<br>" & "<br>"
  42.  
  43.  
  44.  
  45. With objmail
  46. .Display
  47. End With
  48.  
  49. Dim ssta, ssto
  50.  
  51. signature = objmail.HTMLbody
  52.  
  53. ssta = InStr(signature, "<body")
  54. ssto = InStr(signature, "</body>")
  55.  
  56. signature = Mid(objmail.HTMLbody, ssta, ssto - ssta)
  57.  
  58. ssta = InStr(2, signature, "<")
  59.  
  60. signature = Mid(signature, ssta, Len(signature))
  61. 'signature = Mid
  62.  
  63. With objmail
  64. .From = "Bbogdan@anv.uk.com"
  65. .to = huj
  66. .CC = "calibration@anv.uk.com"
  67. .Subject = "Calibration Reminder for your consideration"
  68. .HTMLbody = email_body & vbNewLine & signature
  69.  
  70.  
  71. End With
  72.  
  73. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement