K
karzi
I got an error from my VB program which tries to post a file to the
outlook public folder:
A rule in this public folder prevents a message this large from
being posted.
The machine that runs the VB program uses outlook2003. I can post the
same file with outlook2000 manually without problem. Does anyone know
why?
Dim objDocItem As Outlook.DocumentItem
Dim strFileType As String
Dim intLoc As Integer
Dim objAtt As Outlook.Attachment
' FileSystemObject requires reference to
' Microsoft Scripting Runtime library (scrrun.dll)
Dim fso As Scripting.FileSystemObject
On Error GoTo errorHandler
' check whether file exists
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(strFilePath) Then
' add new DocumentItem to folder
Set objDocItem = objFolder.Items.Add("IPM.Document")
' attach the file and set properties
Set objAtt = objDocItem.Attachments.Add(strFilePath)
objDocItem.Subject = objAtt.FileName
' set special message class for Office document files
intLoc = InStrRev(strFilePath, ".")
strFileType = Mid(strFilePath, intLoc + 1)
Select Case strFileType
Case "doc"
objDocItem.MessageClass =
"IPM.Document.Word.Document.8"
Case "xls"
objDocItem.MessageClass = "IPM.Document.Excel.Sheet.8"
Case "pps", "ppt"
objDocItem.MessageClass =
"IPM.Document.PowerPoint.Show.8"
End Select
objDocItem.Save
Call subError("Postfile", 1001, "Successfully posted " &
strFilePath, 1)
Call delay(20)
Else
Call subError("Postfile", 1001, "Could not find file: " &
strFilePath, 1)
End If
Exit Sub
errorHandler:
Set objDocItem = Nothing
Set fso = Nothing
Set objAtt = Nothing
Call subError("Postfile", Err.Number, Err.Description, 0)
outlook public folder:
A rule in this public folder prevents a message this large from
being posted.
The machine that runs the VB program uses outlook2003. I can post the
same file with outlook2000 manually without problem. Does anyone know
why?
Dim objDocItem As Outlook.DocumentItem
Dim strFileType As String
Dim intLoc As Integer
Dim objAtt As Outlook.Attachment
' FileSystemObject requires reference to
' Microsoft Scripting Runtime library (scrrun.dll)
Dim fso As Scripting.FileSystemObject
On Error GoTo errorHandler
' check whether file exists
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(strFilePath) Then
' add new DocumentItem to folder
Set objDocItem = objFolder.Items.Add("IPM.Document")
' attach the file and set properties
Set objAtt = objDocItem.Attachments.Add(strFilePath)
objDocItem.Subject = objAtt.FileName
' set special message class for Office document files
intLoc = InStrRev(strFilePath, ".")
strFileType = Mid(strFilePath, intLoc + 1)
Select Case strFileType
Case "doc"
objDocItem.MessageClass =
"IPM.Document.Word.Document.8"
Case "xls"
objDocItem.MessageClass = "IPM.Document.Excel.Sheet.8"
Case "pps", "ppt"
objDocItem.MessageClass =
"IPM.Document.PowerPoint.Show.8"
End Select
objDocItem.Save
Call subError("Postfile", 1001, "Successfully posted " &
strFilePath, 1)
Call delay(20)
Else
Call subError("Postfile", 1001, "Could not find file: " &
strFilePath, 1)
End If
Exit Sub
errorHandler:
Set objDocItem = Nothing
Set fso = Nothing
Set objAtt = Nothing
Call subError("Postfile", Err.Number, Err.Description, 0)