Private Sub ComboBox1_Change()
End Sub
Private Sub ComboBox3_Change()
Dim objMsg As Outlook.MailItem
Set objMsg = Outlook.ActiveInspector.CurrentItem
Dim OSubject As String
objMsg.Subject = Left(objMsg.Subject, 16) & ComboBox3.Text
End Sub
Private Sub CommandButton1_Click()
Dim objMsg As Outlook.MailItem
Set objMsg = Outlook.ActiveInspector.CurrentItem
Dim OSubject As String
If ComboBox1.Text = "1068 - MUGCF" And OptionButton1 = True Then
fn = "....1068 - GC.txt"
f = FreeFile
Open fn For Input As f
num = Val(Input(LOF(f), #f))
Close f
Open fn For Output As f
Print #f, num + 1
Close f
'OSubject = objMsg.Subject
'objMsg.Subject = Replace(objMsg.Subject, "(TR-", "(GC-")
objMsg.Subject = Replace(objMsg.Subject, "###", Format(num, "000"))
End If
If ComboBox1.Text = "1068 - MUGCF" And OptionButton2 = True Then
fn = "....1068 - TR.txt"
f = FreeFile
Open fn For Input As f
num = Val(Input(LOF(f), #f))
Close f
Open fn For Output As f
Print #f, num + 1
Close f
'OSubject = objMsg.Subject
'objMsg.Subject = Replace(objMsg.Subject, "(TR-", "(TR-")
objMsg.Subject = Replace(objMsg.Subject, "###", Format(num, "000"))
End If
UserForm1.Hide
End Sub
Private Sub CommandButton2_Click()
UserForm1.Hide
End Sub
Private Sub OptionButton1_Click()
Dim objMsg As Outlook.MailItem
Set objMsg = Outlook.ActiveInspector.CurrentItem
Dim OSubject As String
OSubject = objMsg.Subject
objMsg.Subject = Replace(OSubject, "TR", "GC")
End Sub
Private Sub OptionButton2_Click()
Dim objMsg As Outlook.MailItem
Set objMsg = Outlook.ActiveInspector.CurrentItem
Dim OSubject As String
OSubject = objMsg.Subject
objMsg.Subject = Replace(OSubject, "GC", "TR")
End Sub
Private Sub UserForm_Activate()
ComboBox1.AddItem "1068 - MUGCF"
ComboBox1.AddItem "1071 - Flinders St"
ComboBox1.AddItem "1356 - Mt Piper"
ComboBox3.AddItem "RFI Register"
ComboBox3.AddItem "IFC Package"
End Sub
Private Sub Combobox1_Click()
'Dim strName As String
Dim objMsg As Outlook.MailItem
Set objMsg = Outlook.ActiveInspector.CurrentItem
Select Case ComboBox1.Text
Case "1068 - MUGCF"
objMsg.Subject = "1068 (GC-###) - "
objMsg.CC = "..."
OptionButton1.Value = True
ComboBox3.Value = ""
Case "1071 - Flinders St"
objMsg.Subject = "1071 (GC-###) - "
objMsg.CC = "..."
OptionButton1.Value = True
ComboBox3.Value = ""
Case "1356 - Mt Piper"
objMsg.Subject = "1356 (GC-###) - "
objMsg.CC = "..."
OptionButton1.Value = True
ComboBox3.Value = ""
Case Else
NoJobNumber
End Select
End Sub