I am new to SharePoint programming and i have this problem which i have no idea of solving. so i will appreciate any help i can get.
i written a macro for outlook 2000 that allows me to save the selected email to sharepoint passing along the different fields such as from, to, subject etc;
i can successfully pass the file and properties...
my problem is when i click the 'show actions' link which usually shows the fields, properties and the task i am allowed to do, now when i click the link it only open the file that i saved.
the strange thing is when i right-click the saved file in the web folder, it shows everything that it is suppose to show.
below is the function that i have written, anyone please tell me what is wrong:
Function ToSharePoint(path As String, fileName As String, objMsg As Object)
' this function sends the file to SharePoint.
' all the neccessary fields are passed and the file is published
Dim objOL As Outlook.Application
Dim objAttachments As Outlook.Attachments
Dim objDoc As New PKMCDO.KnowledgeDocument
Dim oVer As New PKMCDO.KnowledgeVersion
Dim objStream
Dim oField
Const adCreateOverwrite = &H4000000
Const adCreateCollection = &H2000
Dim strTime As String
Dim strBody As String
On Error Resume Next
'Send file to sharepoint server
Set oField = objDoc.Fields
objDoc.ContentClass = "urn:content-classes:Emails"
Set objStream = objDoc.OpenStream
objStream.Type = adTypeBinary
objStream.SetEOS
objStream.LoadFromFile path
objStream.Flush
Set objStream = Nothing
objDoc.DataSource.SaveTo " & _
fileName, , , adCreateOverwrite
objDoc.DataSource.Open oField.Value, , adModeReadWrite
oVer.Checkout objDoc
'Inputting the profiles properties
' set the received time as a string
strTime = objMsg.ReceivedTime
' set the body as a string
strBody = objMsg.Body
objDoc.Author = objMsg.SenderName
objDoc.TITLE = objMsg.Subject
objDoc.Fields("urn:schemas-microsoft-comfficeffice#From" = objMsg.SenderName
objDoc.Fields("urn:schemas-microsoft-comfficeffice#Subject" = objMsg.Subject
objDoc.Fields("urn:schemas-microsoft-comfficeffice#To" = objMsg.To
objDoc.Fields("urn:schemas-microsoft-comfficeffice#CC" = objMsg.CC
objDoc.Fields("urn:schemas-microsoft-comfficeffice#BCC" = objMsg.BCC
objDoc.Fields("urn:schemas-microsoft-comfficeffice#Body1" = strBody
objDoc.Fields("urn:schemas-microsoft-comfficeffice#Datetime" = strTime
objDoc.Categories = Array(":EMails"
objDoc.Fields.Update
objDoc.DataSource.save
' checkin the file
oVer.Checkin objDoc
' publishing the file
oVer.Publish objDoc
oVer.Approve objDoc
End Function
i'm not sure if i put across my problem correctly, if anyone have any queries, feel free to reply me.
i written a macro for outlook 2000 that allows me to save the selected email to sharepoint passing along the different fields such as from, to, subject etc;
i can successfully pass the file and properties...
my problem is when i click the 'show actions' link which usually shows the fields, properties and the task i am allowed to do, now when i click the link it only open the file that i saved.
the strange thing is when i right-click the saved file in the web folder, it shows everything that it is suppose to show.
below is the function that i have written, anyone please tell me what is wrong:
Function ToSharePoint(path As String, fileName As String, objMsg As Object)
' this function sends the file to SharePoint.
' all the neccessary fields are passed and the file is published
Dim objOL As Outlook.Application
Dim objAttachments As Outlook.Attachments
Dim objDoc As New PKMCDO.KnowledgeDocument
Dim oVer As New PKMCDO.KnowledgeVersion
Dim objStream
Dim oField
Const adCreateOverwrite = &H4000000
Const adCreateCollection = &H2000
Dim strTime As String
Dim strBody As String
On Error Resume Next
'Send file to sharepoint server
Set oField = objDoc.Fields
objDoc.ContentClass = "urn:content-classes:Emails"
Set objStream = objDoc.OpenStream
objStream.Type = adTypeBinary
objStream.SetEOS
objStream.LoadFromFile path
objStream.Flush
Set objStream = Nothing
objDoc.DataSource.SaveTo " & _
fileName, , , adCreateOverwrite
objDoc.DataSource.Open oField.Value, , adModeReadWrite
oVer.Checkout objDoc
'Inputting the profiles properties
' set the received time as a string
strTime = objMsg.ReceivedTime
' set the body as a string
strBody = objMsg.Body
objDoc.Author = objMsg.SenderName
objDoc.TITLE = objMsg.Subject
objDoc.Fields("urn:schemas-microsoft-comfficeffice#From" = objMsg.SenderName
objDoc.Fields("urn:schemas-microsoft-comfficeffice#Subject" = objMsg.Subject
objDoc.Fields("urn:schemas-microsoft-comfficeffice#To" = objMsg.To
objDoc.Fields("urn:schemas-microsoft-comfficeffice#CC" = objMsg.CC
objDoc.Fields("urn:schemas-microsoft-comfficeffice#BCC" = objMsg.BCC
objDoc.Fields("urn:schemas-microsoft-comfficeffice#Body1" = strBody
objDoc.Fields("urn:schemas-microsoft-comfficeffice#Datetime" = strTime
objDoc.Categories = Array(":EMails"
objDoc.Fields.Update
objDoc.DataSource.save
' checkin the file
oVer.Checkin objDoc
' publishing the file
oVer.Publish objDoc
oVer.Approve objDoc
End Function
i'm not sure if i put across my problem correctly, if anyone have any queries, feel free to reply me.