I have the following code using DSOFile to obtain custom file data from files stored and add them to a DataSet and whist this works on a local drive URI formats are not supported by the DirectoryInfo command and I need this to work on SharePoint;
I am self taught so I would like some tips as to where I should be looking for the following code to be SharePoint Friendly - I am aware that it will need a complete rewrite. I see various items on httpwebrequest but am I barking up the wrong tree ?
m_oDocument = New DSOFile.OleDocumentPropertiesClass
m_oDocument.Open(sFile, fOpenReadOnly, DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess)
lbFileName.Text = m_oDocument.Name
lbFilePath.Text = m_oDocument.Path
Dim lvItem As ListViewItem
Dim dsNewRow As DataRow
dsNewRow = MSGFileInfo.NewRow()
oSummProps = m_oDocument.SummaryProperties
' Get title
dsNewRow("MSubject") = oSummProps.Title
Dim FileSize As Double = GetFileSize(sFile)
If FileSize / 1024 > 1000 Then
FileSize = FileSize / 1024 / 1024
Else
FileSize = FileSize / 1024
End If
dsNewRow("MSize") = Str(Convert.ToInt64(FileSize)) & "KB"
Dim TempString As String
For Each oCustProp In m_oDocument.CustomProperties
If oCustProp.Type <> DSOFile.dsoFilePropertyType.dsoPropertyTypeUnknown Then
lvItem = GetLvItemForProperty(oCustProp.Name, CStr(oCustProp.Value), oCustProp.Type)
CustListView.Items.Add(lvItem)
TempString = CStr(oCustProp.Name)
Select Case TempString
Case "To"
dsNewRow("MTo") = CStr(oCustProp.Value)
Case "ConversationTopic"
dsNewRow("MConv") = CStr(oCustProp.Value)
Case "Importance"
dsNewRow("MImport") = CStr(oCustProp.Value)
Case "CC"
dsNewRow("MCC") = CStr(oCustProp.Value)
Case "Type"
dsNewRow("MType") = CStr(oCustProp.Value)
Case "Attach Count"
dsNewRow("MAttach") = CStr(oCustProp.Value)
Case "SentOn"
dsNewRow("MSent") = CStr(oCustProp.Value)
Case "ReceivedTime"
dsNewRow("MReceived") = CStr(oCustProp.Value)
Case "From"
dsNewRow("MFrom") = CStr(oCustProp.Value)
Case "Body"
dsNewRow("MBody") = CStr(oCustProp.Value)
End Select
End If
Next oCustProp
MSGFileInfo.Rows.Add(dsNewRow)
DataGridView1.Update()
I am self taught so I would like some tips as to where I should be looking for the following code to be SharePoint Friendly - I am aware that it will need a complete rewrite. I see various items on httpwebrequest but am I barking up the wrong tree ?
m_oDocument = New DSOFile.OleDocumentPropertiesClass
m_oDocument.Open(sFile, fOpenReadOnly, DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess)
lbFileName.Text = m_oDocument.Name
lbFilePath.Text = m_oDocument.Path
Dim lvItem As ListViewItem
Dim dsNewRow As DataRow
dsNewRow = MSGFileInfo.NewRow()
oSummProps = m_oDocument.SummaryProperties
' Get title
dsNewRow("MSubject") = oSummProps.Title
Dim FileSize As Double = GetFileSize(sFile)
If FileSize / 1024 > 1000 Then
FileSize = FileSize / 1024 / 1024
Else
FileSize = FileSize / 1024
End If
dsNewRow("MSize") = Str(Convert.ToInt64(FileSize)) & "KB"
Dim TempString As String
For Each oCustProp In m_oDocument.CustomProperties
If oCustProp.Type <> DSOFile.dsoFilePropertyType.dsoPropertyTypeUnknown Then
lvItem = GetLvItemForProperty(oCustProp.Name, CStr(oCustProp.Value), oCustProp.Type)
CustListView.Items.Add(lvItem)
TempString = CStr(oCustProp.Name)
Select Case TempString
Case "To"
dsNewRow("MTo") = CStr(oCustProp.Value)
Case "ConversationTopic"
dsNewRow("MConv") = CStr(oCustProp.Value)
Case "Importance"
dsNewRow("MImport") = CStr(oCustProp.Value)
Case "CC"
dsNewRow("MCC") = CStr(oCustProp.Value)
Case "Type"
dsNewRow("MType") = CStr(oCustProp.Value)
Case "Attach Count"
dsNewRow("MAttach") = CStr(oCustProp.Value)
Case "SentOn"
dsNewRow("MSent") = CStr(oCustProp.Value)
Case "ReceivedTime"
dsNewRow("MReceived") = CStr(oCustProp.Value)
Case "From"
dsNewRow("MFrom") = CStr(oCustProp.Value)
Case "Body"
dsNewRow("MBody") = CStr(oCustProp.Value)
End Select
End If
Next oCustProp
MSGFileInfo.Rows.Add(dsNewRow)
DataGridView1.Update()