Importing folders and subfolders into RoboHTML Project

Question: Is there a way to import folders and subfolders into an existing RoboHelp HTML project?

Answer: You can't import folders and subfolders into RoboHelp directly, but you can by following the steps outlined in this month's tip. This technique is useful when you have many HTML files to import into a project, but no solution is offered for importing index entries, table of contents entries, or any files stored outside the folders you want to import.

Let's say you have the following sets of folders and sub-folders and you want to add them to an existing RoboHelp project.

These folders may contain hundreds of files, graphics, sounds, and multimedia files. Below are a few scenarios when you may want to import files and folders into an existing RoboHelp HTML project.

The following steps will help you accomplish this task.  You should attempt this technique on a backup project:

STEP 1

First, you must run a DIR command at a Command prompt and save the output to a text file.

  1. Open a Command Prompt and navigate to the Root folder you wish to import into another RoboHelp project.

  2. Type: DIR /b /s >files.txt and press Enter.
    This command creates an output file containing a list of all files in all sub folders. The output file is shown in Step 2 below. The text file is saved to the current folder.

STEP 2

Edit the resulting text file to remove all absolute path information.

  1. Open Windows Explorer.

  2. Navigate to the folder containing files.txt.

  3. Open the text file in a word processor and remove all the path information, so lines that look like:

     

  4. ...now read as:
    Note that folders (lines without file extensions on the end) can be deleted; you should also delete the file.txt output file from the list.

    Be aware that files in the root folder of a RoboHelp project will contain extensions such as .CHM, .MPJ, .HHP, .HHC, .HHK, .BRS, etc.  These files should be deleted from the list.

    In addition, if a line does not end with an extension, it is a folder and can be deleted.

STEP 3

Copy the path information created in the previous step and paste it into an existing HTML Help Project (.HHP) file.

  1. Highlight and copy the new path information.

  2. Open a project HHP file in Notepad and locate the [FILES] section.

  3. Paste the content into the [FILES] section either above, or below the list of existing files.

  4. Save and close the Project.HHP file.

STEP 4

Copy the folders and files you want to import to the RoboHelp project, and paste them into the RoboHelp project.

  1. Open Windows Explorer and navigate to the folder you want to "import" into a RoboHelp project.

  2. Copy all the files and folders that were included in the DIR command.

  3. Paste them into the Project in the exact folder location as specified in the [FILES] section.

STEP 5

Open the project .HHP file in RoboHelp.

  1. Open the .HHP file in RoboHelp.

  2. Click No to rebuild the MPJ file.

  3. If you experience broken links, it is not the end of the world.  In fact, RoboHelp is doing you a big favor by identifying problems for you.  Take a close look at image folders for files containing red Xs, as below.

  4. Double click any broken links and use the Edit command in the Topic References dialog to resolve any broken links you have. If you have links that go outside the folders you imported, those links will most certainly will be broken.

  5. You will have some clean-up work ahead, but the major task of moving the folders into the project is complete and can be accomplished in a short amount of time.

Next, Free Utilities from eHelp