Thanks, Kate, but I don’t think that’s quite what I am trying to do. I’m trying to open a document, and then run something like this:
intDPCount = boDoc.DataProviders.Count
For j = 1 To intDPCount
Set boDP = boDoc.DataProviders.Item(j)
boDP.Load
So far, that all works. That starts a loop for each data provider. Next, to obtain the current universe (and domain) from the dp use this:
strFromUniverse = boDP.Universe
strFromDomain = boDP.Universe.DomainName
To set the “transfer to” universe and domain, I tried this:
strToUniverse = boDP.Universe
strToDomain = "."
That doesn’t work. For one thing, the universe domain is read only. So what I really need is a way to specify the “.” universe. But since there are two copies of the same universe (with the same name and everything) that has proved to be an issue. But, once I identify the universe, I want to do this:
boDP.ChangeUniverse (strToUniverse)
boDP.Unload
Next j
The ChangeUniverse() method switches the DP from one universe to another. The problem is that the domain is read only; I can’t change the domain of the universe, which makes sense. What I need to do, however, is change the document from (for example) Beach(Universe) to Beach(.).
Suppose you have a universe called XYZ, and that universe exists both locally (as a “Saved for all users” resource) and in the domain called “Production”. When you look at the list of universes, you’ll see XYZ with a domain of Production, and XYZ with a domain of “.”. The one with the dot is the non-exported version.
What I am working on now is getting a list of all universes, building an array that shows me which universe is exported and which isn’t, then using the index number (rather than the name) in the switch logic. I’ll post some code if I get it working.
The actual problem is this: I need to migrate hundreds of reports from one repository to another. So I have written VBA code to access the repository, and download each and every report. I then need to do a “Save for All Users” on the report. I also need to point them to a local version of the universe, so that when I log in to the second repository the document is pointing to a valid universe. That’s the part I am working on now.
Finally, I have written code to export each document to the new repository, and preserve the current category assignments.
I may be working up a lather for nothing; BusObj lets me export the documents without assigning them to a new universe, but I need to make sure that the documents don’t “break” when someone imports / opens one of them from the new repository. I plan on reassigning the document from the “.” universe back to a version in the repository during the export process, so I’ll be doing the same process in reverse.
So that’s the issue. Not so much in a nutshell. 8)
Dave Rathbun (BOB member since 2002-06-06)