- How to export and import application preferences, text styles, XML tags, object styles, and swatches.
This code contains seven export methods and two import method. The seven export methods show how to export the previously mentioned application resources as INX Snippets. The two import methods import any one of these INX Snippets into the application. The difference is ImportToAppWithOptions() shows how to set import options before importing.
For simplicity the 7 exports all write out a file named SnpShareAppResources.xml in the users application preference folder. The import methods read in this file, updating the specified resources.
Note: This also runs in InCopy, but you will run into several instances of an assert in the debug build. The assert is related to the scriptability of a UI color used in InCopy. It's a bug, but it's safe to ignore.
| ErrorCode SnpShareAppResources::ImportToAppWithOptions | ( | | ) | |
Temporarily sets IAppPrefsImportOptions and Imports the INX Snippets back into the application.
The IAppPrefsImportOptions interface is used to specify a policy for dealing with matching and
non-matching existing items in lists. For example, if you have three Paragraph Styles A,B, and C,
what happens if you import Paragraph Styles B and C. You could or delete A. And, you could keep
or replace B and C.
- Precondition
- A valid INX snippet named SnpShareAppResources.xml should exist in the users preference folder. Run one of the export routines to create one.
- Returns
- kSuccess on success, or kFailure or another ErrorCode value identifying the error.
- Postcondition
- The application defaults and preferences should be updated.