Problems With Uploading a document using PKMCDO.KnowledgeDocument
- From: "Gary Owen" <GaryO@xxxxxxxxxxxxxxx>
- Date: Wed, 14 Sep 2005 11:24:00 +0100
Hello there,
I am in a bit of a dilema at the moment. I am using the folllowing code to
upload a file to a sharepoint document library. The only problem is that I
always get the "The parameter is incorrect." (code -2147024809 ) error when
doing the oDoc.DataSource.SaveTo
Function CreateDocument(sFilestream, sHref, sCC) As PKMCDO.KnowledgeDocument
Dim oDoc As PKMCDO.KnowledgeDocument
Dim oStream As ADODB.Stream
Dim nIndex As Integer
Dim sPropName As String
Set oDoc = CreateObject("CDO.KnowledgeDocument")
Set oStream = oDoc.OpenStream
oStream.Type = adTypeBinary
oStream.SetEOS
oStream.LoadFromFile sFilestream
oStream.Flush
oDoc.ContentClass = sCC ' "urn:content-classes:basedocument"
End If
Call oDoc.DataSource.SaveTo(sHref, , ,
RecordCreateOptionsEnum.adCreateOverwrite)
Set CreateDocument = oDoc
End Function
does anybody have any idea on what might be causing this. I know that the
url and local file are correct as I can go into sharepoint and see the
document, but it has no data.
Many thanks.
Gary
.
- Prev by Date: Re: document change notification
- Next by Date: Adding hyperlink label to tool part.
- Previous by thread: Comma in Web Part parameters
- Next by thread: Adding hyperlink label to tool part.
- Index(es):
Relevant Pages
|