API ImportBookmarks - causing duplicates on server
I'm trying to do something that means that I can load specific sets of bookmarks on document startup depending upon the logged in user... and it works GREAT in the Personal Edition.
However, deploying this on the server is causing some issues.
On the server, when the doc loads, my test user is associated with three bookmarks which I determine in a macro and then load each in turn. Each of the bookmark files contains a single bookmark with pretty simple filtering, just proof-of-concept at the moment;
* Global: No Filtering
* Birmingham: Branch = "Birmingham"
* Manchester: Branch = "Manchester"
Anyway, having determined the list of bookmark files I then proceed to load them, with a bit of reassuring debugging.
for iLoop = 0 to ubound ( vArray ) - 1
msgbox "Applying " & vArray( iLoop ) & " for user " & strOSUser
ActiveDocument.ImportBookmarks vArray( iLoop ), 0
What's happening in PE is that I get three bookmarks, and I can press a button and manually repeat the process and I've still got three bookmarks.
On the server though, it seems as though every time I load a BM file, as well as adding the new BM it is also duplicating all of the BMs that are already present. (Let me point out at this point that I have tried 0, 1, 2, and 3 as the last parameter on the ImportBookmarks call and it's the same.) (It's also creating the things as Server bookmarks, but I'm not too fussed about that.)
So, what is happening is;
Bookmark Global created
Bookmark Global *DUPLICATED*
Bookmark Birmingham created
Bookmark Global DUPLICATED
Bookmark Global DUPLICATED
Bookmark Birmingham DUPLICATED
Bookmark Manchester created
So, although I have imported three files each with one BM in them I now have 4 x Global, 2 x Birmingham, and 1 x Manchester... and this happens no matter what I put as the last parameter on the ImportBookmarks call - the one that is supposed to control how duplicates are handled. (And if I press the 'test it manually' button and load the same 3 BM files I end up with something like 56!)
Now the question:
*** What makes that last parameter exclude a bookmark from being imported please? What is it that QV is checking to see if it's a duplicate? If it's the ID then I guess I'm a bit done-for as the BMs are assigned new IDs when they get imported. What do I set the last value to, as 0, 1, 2, and 3 seem to all have the same effect and there's no duplicate stripping performed at all on the Server version, but the PE is working just dandy. ***
Oh, and it's not just duplicating the ones that I import, it's all Server bookmarks, eg/ If I have 10 Server bookmarks that I've created manually and I use the API to import another, I now have 21 user bookmarks.