Short User Guide to creating Blogger Blogbooks from Backup/Export File using BlogBackupToBook VB.Net project and ExportFileFilterAndGenBook and another VBA projects' macros/code (free and open source)

Last updated on 21 Nov. 2023


BlogBackupToBook software creates HTML blogbook(s) from Blogger blog XML Backup/Export files. It also allows for filtering the output HTML blogbook(s) by content matching strings, by published and/or updated date range and by an index(es) list where the index(es) are positions of posts and pages entries in the Blogger XML Backup/Export file. 

============================================

I decided to put up and publish this post now on 5 Sep. 2023 while this work is in progress, as I wanted to ensure that whatever work I have done till now is available for interested readers. 

Note: The earlier title of this post was: "Short User Guide to creating Blogger Blogbooks from Backup/Export File using ExportFileFilterAndGenBook and another VBA projects' macros/code (free and open source)" and its contents covered that. Later I ported the code of the two VBA projects mentioned, to VB.Net and consolidated them into one project. For more about it, see Ported ExportFileFilterAndGenBook and ExportFileFilterByIndexList from VBA to BlogBackupToBook VB.Net single project of Visual Studio 2022 Community Edition,  https://ravisiyermisc.blogspot.com/2023/09/ported-exportfilefilterandgenbook-from.html .

Now I am modifying this post to additionally cover the VB.Net project by providing short additional info. The reader is requested to bear with the main content of the post dealing with the VBA projects and only small additional 'change' info. provided for the VB.Net project.

This post gives only a short statement on how other users/readers can create Microsoft Visual Basic for Applications (VBA) projects using the source code shared in the VBA project post links below. The source code files are on Google Drive. When I shared the Microsoft Word document with the macros on Google Drive, it gave some warning (similar to or same as: "Your file may violate Google Drive's Terms of Service") and so I removed it. I tried out sharing it within a zip file and that did not provide any such warnings for some time. But later I got the warning for another such zip file! I decided to then delete all zip files having Word documents with macros. 

Readers who want to know more about using VBA may visit sites teaching that. My code for the projects mentioned below, has used it with Microsoft Word but I think it should work perhaps with some slight changes, for Microsoft Excel too. Two pages that may be helpful: 
I should also mention that perhaps it would have been better if I had done the work in Microsoft Visual Basic (VB) instead of VBA. It is just that when I started the work, I did not have Visual Studio installed on my PC but had Microsoft Office 2007 including VBA. So I did the work in VBA.

But I do think that it should not be too difficult to port my VBA code to VB, after which an executable program can be created which can be downloaded by others and then run, which would be simpler than setting up the VBA projects and then running the VBA macros. As my VBA code is open source and free, any reader who would like to port it to VB, is absolutely welcome to do that. It would be great if the ported code is also open source and free, but that is not mandatory.

This code works for my blogs, in my testing so far at least. If the code does not work for other users/readers for their blogs, I don't think I will be able to do much. They may have to attempt to fix the code so that it works for their blogs. 

The main VBA project that I use now to create Blogger blogbooks from Blogger backup/export file is: ExportFileFilterAndGenBook which is described in the post: ExportFileFilterAndGenBook: Filter Blogger XML Backup file based on date range, produce HTML Blogbook filtered by search string, Split it and Generate Contents Links (VBA project), https://ravisiyermisc.blogspot.com/2023/08/exportfilefilterandgenbook-vba-code-to.html . This post has screenshots of some key Forms used in this project.

VB.Net version program change: See Ported ExportFileFilterAndGenBook and ExportFileFilterByIndexList from VBA to BlogBackupToBook VB.Net single project of Visual Studio 2022 Community Edition,  https://ravisiyermisc.blogspot.com/2023/09/ported-exportfilefilterandgenbook-from.html .

 Those screenshots are repeated below:

[On PC desktop/laptop, to open pic in larger resolution (if available), right-click on pic followed by open link (NOT image) in new tab/window. In new tab/window you may have to click on pic to zoom in.]


Form: Top Level Run Options (of ExportFileFilterAndGenBook project)

VB.Net version program change: 


    
Above pics: VB.Net version program: Main Form with Default buttons disabled (1st pic) and then enabled (2nd pic).

Form: Parameters for Blog Export File Search To Book

Form: Specify Program Parameters (for Generate Contents Links List and/or Split Blogbook)

Form: Specify Date Ranges for Filter

At times, I additionally use the VBA project: ExportFileFilterByIndexList which is described in the post: ExportFileFilterByIndexList: VBA code to filter Blogger XML Backup/Export file based on Entry Index List text file, https://ravisiyermisc.blogspot.com/2023/08/exportfilefilterbyindexlist-vba-code-to.html . This post has a screenshot of the key form used in this project. That screenshot is repeated below:


This post gives a short user guide to using above projects to create Blogger blogbooks.

A) Main Use case: Generate full blogbook from a backup/export XML file

  1. Run ShowTopLevelRunOptions macro/sub in ExportFileFilterAndGenBook project and chose "Prompt for Input and Run" in "Generate HTML Blogbook ..." frame.
    1. In the file dialog prompt, specify the Blogger backup/export XML file as input file.
    2. In the "Parameters for BlogExportFileSearchToBook" form, leave the Search String Array as blank and leave the default checked option for "Create blog book ..." unchanged. Click on Run button.
    3. This will generate an HTML blog book having all contents (posts & pages along with associated comments) of the input Blogger backup/export XML file. It will also generate a main log file (text with tab separated fields for the main entries), a comments dictionary HTML file and a comments log file. The comments dictionary and comments log file are not important for general usage. I need it to verify that comments were picked up properly and so it is more of a debugging aid than regular output files. The main log file gives top-level info. of all entries that were written in the blogbook file. This main log file can be viewed in any text viewer/editor but sometimes it is convenient to view the log file in Microsoft Excel (some other spreadsheet program may also be able to do it) where the tab separated fields are shown in separate columns. This makes it easy to view data of some specific column(s) for many rows or each row. The main log file typically is much smaller than the associated HTML blogbook, as it has only one line per post/page, and so it is easier to go through the main log file to know which posts and pages are contained in the blogbook. The main log file also captures the parameters and input file specified for the run, and also the filename of the blogbook that was created by the run.
  2. Then (without exiting from Run Level Options form) choose "Prompt for Input and Run" in "Generate Contents Links List ..." frame and provide above step blog book HTML file as input file. 
    1. In the "Specify Program Parameters" form, leave all the fields as their default values. Click 'Run Program' button.
    2. This will generate a new HTML blogbook file which has all the contents of the input file, plus a Contents Internal Links list (like Table of Contents) for each post and page in the blogbook. This Contents Links list makes it easy for the user to go to any post/page he/she is interested in by clicking on the title of post/page link in the list.
    3. A log file is also generated. 
  3. If required, create a pdf file from above HTML output file (with Contents Links) by opening it in a browser like Chrome and then using its Print command  and choosing Destination as "Save As PDF".
  4. If the output HTML blogbook is large and so takes lot of time to load in a browser, or for some other reason, you may want to split it into smaller HTML files. To do that, use the alternative main use case B) given below.
In steps 1and 2 above, message box(es) are shown mentioning the output filenames (and output directory as all output files are created in one directory, typically the same directory as main input file).

B) Alternative Main Use case: Generate full blogbook parts of around a particular split size from a backup/export XML file
This use case comes into play usually when the output HTML blogbook is large and so takes lot of time to load in a browser. That issue can be solved by splitting the file into smaller HTML blogbook parts. The variation from A) Main use case ..., is as follows:
  1. In step 2, substep 1, in the "Specify Program Parameters" form, specify the split size (e.g. 5242880 which is 5 MB). Rest of the process is the same, except that if equivalent step 3 is done, multiple PDF files will be created, one for each split output HTML blogbook part file.

C) Use case: Generate blogbook from a backup/export XML file satisfying certain search criteria
The variation from A) Main use case ..., is as follows:
  1. In step 1, substep 2, in the "Parameters for BlogExportFileSearchToBook" form, provide the required search strings and also use the appropriate option of "Combine Search Strings"... (Unchecked is OR, checked is AND).

D) Use case: Generate blogbook from a backup/export XML file satisfying certain published and/or updated date range criteria.
The variation from A) Main use case ..., is as follows:
  1. In step 1, prior to substep 1, run ShowTopLevelRunOptions macro/sub in ExportFileFilterAndGenBook project and chose "Prompt for Input and Run" in "Filter Blog XML Backup/Export File ..." frame. 
    1. In the file dialog prompt, specify the Blogger backup/export XML file as input file.
    2. In the "Specify Date Ranges for Filter" form, provide the required published date and/or updated date ranges. Then click on "Run Filter" button.
    3. This will generate an XML file which has only pages and posts satisfying the specified date range criteria, and all comments and some header XML entries. A log text file will also be generated. A message box will mention the names of the output files.
  2. In step 1, substep 1, specify the output XML file of above step as main input file (instead of the original Blogger backup/export XML file).

E) Use case: Exclude some posts and pages from HTML blogbook output file(s) for most, if not all, of the above use cases.
This use case is about removing XML entries of some pages/posts from the Blogger Backup/Export XML file and using the modified file as main input file to most, if not all, of the use cases above. This will create blog books based on the above use cases functionality (e.g. blogbook satisfying specified search criteria) but none of the blogbooks created this way will have the pages/posts excluded from the modified Blogger XML Backup/Export file. This approach may be superior to removing these posts/pages again and again from output files created in different runs of above use cases.

The variation from A) Main use case ..., is as follows:
  1. In step 1, prior to substep 1, Run ShowTopLevelRunOptions macro/sub in ExportFileFilterAndGenBook project and click on "Prompt for Input and Run" in "Generate HTML Blogbook ..." frame. 
  2. In the file dialog prompt, specify the Blogger backup/export XML file as input file.
  3. In the "Parameters for BlogExportFileSearchToBook" form, leave the Search String Array as blank and uncheck the option for "Create blog book ..." (so only log files will be created). Click on Run button.
  4. This will generate a main log file (text with tab separated fields for the main entries) and a comments log file. 
  5. Make a copy of the main log file and rename the copy by making the last part of the name like PP-Index.txt (e.g. 20230801-ravisiyer-blog-PP-Index.txt). I refer to this file as the Index List file. In this Index list file, delete the entries of posts and pages that you want to exclude from the output blog books. You may also delete the header and footer content of the main log file as the Index List file's main contents are the first tab-separated field of each post/page entry line which is viewed as the index of the page or post to be picked up from the input file and written to the output file by ExportFileFilterByIndexList macros/subs. 
  6. Run ShowTopLevelRunOptions macro/sub in ExportFileFilterByIndexList project and click on "Prompt for Input and Run" in the Top Level Run Options form that is shown.
  7. Provide the Blogger backup/export XML file and the Index List file as input files.
  8. This should create an XML output file which is a filtered version of the Blogger backup/export XML file, with the filtered version output having all the posts and pages entries whose indexes are mentioned in the Index List file. The posts and pages corresponding to the entries that were deleted or are not present in Index List file, will be excluded from the filtered output XML file.
  9. Now the filtered output XML file mentioned in above step can become the main XML backup input file for ExportFileFilterAndGenBook project macro(s)/subs to create blog books based on some search criteria. The posts and pages corresponding to entries that are omitted from the filtered output XML file will naturally not be part of any blogbook files created. 



Comments

Archive

Show more