Liang Weike wrote: > Hello Carsten, > > I've read the Basic code carefully. And it gave me some references on > how to set up the ImageManager, to insert images and store the changes. > I think I should make use of FileSystemStorageFactory to create a user > folder in user's directory to store images added by users. And then I > ought to connect the new folder with the imported image manager. But now > I'm not clear how to connect them. Could you give me some hints? Thank > you! :-)
Hi Liang Weike, Please look at following Basic snippet: oStorageFactory = createUnoService( "com.sun.star.embed.FileSystemStorageFactory" ) Dim aArgs(1) aArgs(0) = "file:///d:/userimages" aArgs(1) = com.sun.star.embed.ElementModes.READWRITE oStorage = oStorageFactory.createInstanceWithArguments( aArgs ) Dim aProperties(1) as new com.sun.star.beans.PropertyValue aProperties(0).Name = "UserConfigStorage" aProperties(0).Value = oStorage aProperties(1).Name = "OpenMode" aProperties(1).Value = com.sun.star.embed.ElementModes.READWRITE oImageManager = createUnoService( "com.sun.star.ui.ImageManager" ) oImageManager.initialize( aProperties ) The image manager is initialized (oImageManager.initialize(...) with parameters provided as a sequence of com.sun.star.beans.PropertyValues. The oStorage object contains the folder that is used to read/write the image information. The image manager uses this storage object to access the folder. Regards, Carsten --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]