Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete documents from sharepoint using PKMCDO

Status
Not open for further replies.

f0z

Programmer
Jan 10, 2003
48
0
0
US
Hi,

I'm trying to delete a document that's in the sharepoint document store but I'm having difficulty with the parameters that the PKMCDO.KnowledgeDocument.Delete() function requires.

It's asking for a (ref object pvarChildernUrl)

This variable is used to specify children of the document that you could also delete if you wanted. If this is set to null well then just the current object gets deleted.

But if I leave out the required variable, I get an error, if I put null as the parameter I get a error too.

I think its just something that I'm doing wrong with the variable type.

Any help is much appreciated,

Cheers,

foz
 
Here's what the microsoft site has to say about it(from
pvarChildrenURL, Optional
Variant that contains an array of Variants. Each Variant in the array contains a String that contains the Uniform Resource Identifier (URI) of the child object to delete. If the parameter is omitted, then the item itself is deleted from the store. If the parameter is passed, the specified child items are deleted, but the item itself is not deleted.

From reading the first line you'd imagine that this parameter is optional but it's not. I've tried passing a null object reference but I'm not getting anywhere.

Code:
object urls = new object[]{};
knowDoc.Delete(ref urls);

If anyone can help it would be great cheers foz.
 
Ok,

After a week messing around with this thing I stumble across the following on google groups:

Next thing is that after several weeks of programming against SPS with C#, I regret using this tool. If you can, use VB.Net for accessing SPS/PKMCDO, e.g. I found no solution for deleting documents with C# and PKMCDO (if you did, please drop me mail...). You will also find much more docs for PKMCDO and VB than for C# and you don't run into these stupid VB6-PKMCDO optional parameter problems.

It would seem that I'm not the only one with this problem, I wonder if it's even possible.

For now I'm just going to abandon C#.Net and use VB.Net for this solution.

Cheers to anyone that had a look at my problem.

f0z
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top