Ok, one step forward one step back ...userform is not displaying again
Here is the entirity of the code as I can not see the syntax that I am
missing. I also removed much of the history of this message. It was getting a
bit long.
<Microsoft Outlook Objects>
<ThisOutlookSession>
Option Explicit
Private WithEvents Inspectors As Outlook.Inspectors
Private Sub Application_Startup()
Set Inspectors = Application.Inspectors
End Sub
Private Sub m_oInspectors_NewInspector(ByVal Inspector As Inspector)
If Inspector.CurrentItem.Subject = TEMPLATE_SUBJECT Then
modTimer.EnableTimer 40, Me
End If
End Sub
Public Sub Timer()
Dim oTSGRequest As TSGRequest
modTimer.DisableTimer
Set oTSGRequest = New TSGRequest
oTSGRequest.Show 1
End Sub
</ThisOutlookSession>
</Microsoft Outlook Objects>
<Forms>
<TSGRequest>
Private Sub CmdBtnSubmit_Click()
Set oMail = Application.ActiveInspector.CurrentItem
ReplaceCenter = "<TxtBxCenter>"
ReplaceHO = "<TxtBxHO>"
ReplaceHC = "<TxtBxHC>"
ReplaceTZ = "<TxtBxTZ>"
ReplaceTech = "<TxtBxTech>"
ReplacePhone = "<TxtBxPhone>"
ReplaceSev = "<TxtBxSev>"
ReplaceReason = "<TxtBxReason>"
ReplaceDate = "<TxtBxDate>"
ReplaceIssue = "<TxtBxIssue>"
oMail.Subject = Replace(oMail.Subject, ReplaceCenter, TxtBxCenter.Text)
oMail.Body = Replace(oMail.Body, ReplaceCenter, TxtBxCenter.Text)
oMail.Body = Replace(oMail.Body, ReplaceHO, TxtBxHO.Text)
oMail.Body = Replace(oMail.Body, ReplaceHC, TxtBxHC.Text)
oMail.Body = Replace(oMail.Body, ReplaceTZ, TxtBxTZ.Text)
oMail.Body = Replace(oMail.Body, ReplaceTech, TxtBxTech.Text)
oMail.Body = Replace(oMail.Body, ReplacePhone, TxtBxPhone.Text)
oMail.Body = Replace(oMail.Body, ReplaceSev, TxtBxSev.Text)
oMail.Body = Replace(oMail.Body, ReplaceReason, TxtBxReason.Text)
oMail.Body = Replace(oMail.Body, ReplaceDate, TxtBxDate.Text)
oMail.Body = Replace(oMail.Body, ReplaceIssue, TxtBxIssue.Text)
Unload TSGRequest
End Sub
Private Sub CmdBtnClear_Click()
TxtBxCenter = ""
TxtBxHO = ""
TxtBxHC = ""
TxtBxTZ = ""
TxtBxTech = ""
TxtBxPhone = ""
TxtBxSev = ""
TxtBxReason = ""
TxtBxDate = ""
TxtBxIssue = ""
End Sub
Private Sub TSGRequest_Activate()
TxtBxDate.Text = DateAdd("d", 1, Date)
End Sub
</TSGRequest>
</Forms>
<Modules>
<GlobalData>
Public Const TEMPLATE_SUBJECT As String = "TSG Dispatch Center <TxtBxCenter>"
Public Const REPLACE_SUBJECT As String = "<TxtBxCenter>"
</GlobalData>
<modTimer>
Option Explicit
Private Declare Function SetTimer Lib "user32.dll" (ByVal hWnd As Long,
ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As
Long
Private Declare Function KillTimer Lib "user32.dll" (ByVal hWnd As Long,
ByVal nIDEvent As Long) As Long
Const WM_TIMER = &H113
Private hEvent As Long
Private m_oCallback As Object
Public Sub TimerProc(ByVal hWnd As Long, ByVal uMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long _
)
If uMsg = WM_TIMER Then
m_oCallback.Timer
End If
End Sub
Public Function EnableTimer(ByVal msInterval As Long, oCallback As Object)
As Boolean
If hEvent <> 0 Then
Exit Function
End If
hEvent = SetTimer(0&, 0&, msInterval, AddressOf TimerProc)
Set m_oCallback = oCallback
EnableTimer = CBool(hEvent)
End Function
Public Function DisableTimer()
If hEvent = 0 Then
Exit Function
End If
KillTimer 0&, hEvent
hEvent = 0
End Function
</modTimer>
</Modules>
<E-mail Subject>
TSG Dispatch Center <TxtBxCenter>
</E-mail Subject>
<E-mail Body>
Please dispatch Tech to center <TxtBxCenter> to complete <TxtBxIssue>
Technician must call <TxtBxTech> at <TxtBxPhone> after equipment is
installed, for further instructions.
Please dispatch at Severity <TxtBxSev>, <TxtBxReason>.
Equipment will arrive <TxtBxDate> by 10:30 <TxtBxTZ>
Center is open from <TxtBxHO> to <TxtBxHC> <TxtBxTZ>
-- Do not modify below this line dispatch template use only --
Center needs <TxtBxIssue>. Equipment will arrive <TxtBxDate> by 10:30
<TxtBxTZ>
Technician must call <TxtBxTech> at <TxtBxPhone> after equipment is
installed, for further instructions.
Pref: (Y/N) N
Address Verified:
Hours of Oprtn: <TxtBxHO> to <TxtBxHC> <TxtBxTZ>
H/W (Y/N): N
HHA Rcvd# (Y/N):
Multi System (Y/N): Y
Issue/Reason for SEV: Sev <TxtBxSev>, <TxtBxReason>
Esc. Approved By:
</E-mail Body>
Jason