Advertisement
Advertisement
| 05.30.2008 at 02:41AM PDT, ID: 23444038 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: |
Sub Generate_Email(Email_SendTo As String, Email_Subject As String, EmailCCTo As String, EmailAtt As String, SaveOnSend As Boolean)
Dim EmailBCCTo
Dim objNotesSession As Object
Dim objNotesMailFile As Object
Dim ObjNotesDocument As Object
Dim objNotesField As Object
Dim RichTextAttachment As Object
Dim NotesAttach As Object
Dim SendMail As Boolean
On Error GoTo SendMailError
EmailBCCTo = "" ''Optional
''Establish Connection to Notes
Set objNotesSession = CreateObject("Notes.NotesSession")
'Establish Connection to Mail File
'.GetDatabase("SERVER","FILE")
Set objNotesMailFile = objNotesSession.GetDatabase("", "")
'Open Mail
objNotesMailFile.OpenMail
''Create New Memo
Set ObjNotesDocument = objNotesMailFile.CreateDocument
''Create 'Subject Field'
Set objNotesField = ObjNotesDocument.APPENDITEMVALUE("Subject", Email_Subject)
''Create 'Send To' Field
Set objNotesField = ObjNotesDocument.APPENDITEMVALUE("SendTo", Email_SendTo)
''Create 'Copy To' Field
Set objNotesField = ObjNotesDocument.APPENDITEMVALUE("CopyTo", EmailCCTo)
''Create 'Blind Copy To' Field
Set objNotesField = ObjNotesDocument.APPENDITEMVALUE("BlindCopyTo", EmailBCCTo)
''Create 'Body' of memo
Set objNotesField = ObjNotesDocument.CREATERICHTEXTITEM("Body")
With objNotesField
.APPENDTEXT "This e-mail is generated by an automated process."
.ADDNEWLINE 1
.APPENDTEXT "Please follow established contact procedures should you have any questions"
.ADDNEWLINE 2
End With
Call objNotesField.EmbedObject(EMBED_ATTACHMENT, "", EmailAtt)
'Save a copy of the e-mail in the sent folder
objNotesField.SAVEMESSAGEONSEND = SaveOnSend
Call objNotesField.ReplaceItemValue("PostedDate", Now())
''Send the e-mail
ObjNotesDocument.Send (0)
''Release storage
Set objNotesSession = Nothing
Set objNotesMailFile = Nothing
Set ObjNotesDocument = Nothing
Set objNotesField = Nothing
''Set return code
SendMail = True
Exit Sub
SendMailError:
Dim Msg
SendMail = False
End Sub
Sub Create_Email()
Dim Mail_Address As String
Dim Mail_Text As String
Dim Mail_CC As String
Dim Mail_Attach As String
Dim Loop_Counter As Integer
'Now Loop through all the records
'And Only E-mail those PCTS that we have e-mail addresses for
For Loop_Counter = 0 To Last_Formulae_Line
If Worksheets("Check").Range("First_EMail_Flag").Offset(Loop_Counter) = "YES" Then
'Get the mail address
Mail_Address = Worksheets("Check").Range("First_EMail_Address").Offset(Loop_Counter)
'Get the mail text
Mail_Text = Worksheets("Check").Range("First_Mail_Text").Offset(Loop_Counter)
'Get the mail cc address
Mail_CC = Worksheets("Check").Range("First_CC_Address").Offset(Loop_Counter)
'Get the attachment
Mail_Attach = Worksheets("Check").Range("First_Attach").Offset(Loop_Counter)
Call Generate_Email(Mail_Address, Mail_Text, Mail_CC, Mail_Attach, True)
'Update the flag stating that the e-mail has been sent
End If
Next Loop_Counter
|