|
-
Jun 27th, 2001, 09:33 AM
#1
Thread Starter
Addicted Member
Runtime error, type mismatch.
I keep getting this error.
06/27/01 08:35:05 Run time error at line 69. Source: Microsoft VBScript runtime error Error: 800a000d. Description: Type mismatch
here is the code piece that keeps failing.
rpc = Replace(objmessage.Text, chr(13), " ",,,vbBinaryCompare)
rpc = Replace(x(15), chr(10), " ",,,vbBinaryCompare)
Anyone know why.
I have included the whole code below.
Code:
<SCRIPT RunAt=Server Language=VBScript>
'------------------------------------------------------------------------------
'FILE DESCRIPTION: Exchange Server Event Script
'------------------------------------------------------------------------------
Option Explicit
'------------------------------------------------------------------------------
' Global Variables
'------------------------------------------------------------------------------
'------------------------------------------------------------------------------
' Event Handlers
'------------------------------------------------------------------------------
' DESCRIPTION: This event is fired when a new message is added to the folder
Public Sub Folder_OnMessageCreated
Dim objMessage
Dim CDOSession
Set CDOSession = EventDetails.Session
Set objMessage = CDOSession.GetMessage(EventDetails.MessageID,Null)
Dim x(20), z
Dim y
dim rpc
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("\\howbp05\runtimenews$\index.html", 1, True)
Dim fso2, f2
Set fso = CreateObject("Scripting.FileSystemObject")
Set f2 = fso.OpenTextFile("\\howbp05\runtimenews$\live.html", 2, True)
Do Until y > 0
x(0) = f.readline
f2.writeline x(0)
y = InStr(1, x(0), "RunTimeTable", vbTextCompare)
Loop
x(1) = f.readline
f2.writeline x(1)
x(2) = f.readline
f2.writeline x(2)
x(3) = f.readline
z = Left(x(3), InStrRev(x(3), Chr(34) & ">", -1, vbTextCompare) + 1)
f2.writeline z & objmessage.sender & "</FONT></P>"
x(4) = f.readline
f2.writeline x(4)
x(5) = f.readline
f2.writeline x(5)
x(6) = f.readline
z = Left(x(6), InStrRev(x(6), Chr(34) & ">", -1, vbTextCompare) + 1)
f2.writeline z & objmessage.TimeSent & "</FONT></P>"
x(7) = f.readline
f2.writeline x(7)
x(8) = f.readline
f2.writeline x(8)
x(9) = f.readline
z = Left(x(9), InStrRev(x(9), Chr(34) & ">", -1, vbTextCompare) + 1)
f2.writeline z & objmessage.subject & "</FONT></P>"
x(10) = f.readline
f2.writeline x(10)
x(11) = f.readline
f2.writeline x(11)
x(12) = f.readline
rpc = Replace(cstr(objmessage.Text), chr(13), " ",,,vbBinaryCompare)
rpc = Replace(x(15), chr(10), " ",,,vbBinaryCompare)
z = Left(x(12), InStrRev(x(12), Chr(34) & ">", -1, vbTextCompare) + 1)
f2.writeline z & x(15) & "</FONT></P>"
x(13) = f.readline
f2.writeline x(13)
x(14) = f.readline
f2.writeline x(14)
'end of table line
'append on the orig line.
f2.writeline x(1)
f2.writeline x(2)
f2.writeline x(3)
f2.writeline x(4)
f2.writeline x(5)
f2.writeline x(6)
f2.writeline x(7)
f2.writeline x(8)
f2.writeline x(9)
f2.writeline x(10)
f2.writeline x(11)
f2.writeline x(12)
f2.writeline x(13)
f2.writeline x(14)
Do Until f.AtEndOfStream
x(0) = f.readline
f2.writeline x(0)
Loop
objmessage.delete
f.Close
f2.Close
' Const ForReading = 1, ForWriting = 2, ForAppending = 8
' Dim fso, f
' Set fso = CreateObject("Scripting.FileSystemObject")
' Set f = fso.OpenTextFile("\\howbp05\runtimenews$\live.txt", ForAppending, True)
'on error resume next
' f.WriteLine "BOSender"
' f.WriteLine objmessage.sender
' f.WriteLine objmessage.subject
' f.WriteLine objmessage.TimeSent
' f.WriteLine "BOMess"
' f.WriteLine objmessage.text
' f.WriteLine "EOMess"
' f.Close
' objmessage.delete
End Sub
' DESCRIPTION: This event is fired when a message in the folder is changed
Public Sub Message_OnChange
End Sub
' DESCRIPTION: This event is fired when a message is deleted from the folder
Public Sub Folder_OnMessageDeleted
End Sub
' DESCRIPTION: This event is fired when the timer on the folder expires
Public Sub Folder_OnTimer
End Sub
</SCRIPT>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|