Using tiles to visualize Word documents

Using Directory Opus 13.

I wanted to see word documents in a folder not just as a list of documents but also with each document a sort of TOC (table of contents). Think of a series of Word docs as a book or a research project, where each word document is a chapter (the names starting with numbers, for instance), and all the headers (like H1, H2 etc.) as the sub-titles of each chapter. Together, they form a TOC across all documents in the folder. Each main topic is a Word document, but you want to see the overview of the entire thing - and you don't work with a single, gigantic Word document.

Part of my own fancied solution is a VBA macro running in Word (which is fully accessible if it is saved in the "normal.dotm" file, as Word developers know). This macro however can also be run from Directory Opus (DO) by right-clicking on the Word document and run the macro from the context menu, as I will explain. But the visualisation itself is something that could be achieved through DO's powerful tuning options, most particularly its TILES view.

I created a test set with a number of dummy documents. Some have 11 or 12 headers (which had to be displayed in the overview, each within its own tile) - this is more than will normally fit within a normal tile - so the tiles had to be enlarged. Each TOC entry needs a line, and for the height of the tiles it seemed reasonable to show up to 5 TOC entries, something like that. I also needed an indicator saying that not the entire TOC of a document is displayed, so I knew I had to hovering the mouse over the tile - which should show all entries (using the "Info tip" functionality of DO). That was the overall idea.

Unfortunately, tiles cannot automatically adapt their size according to what has to be displayed. Increasing the fixed tile size in DO is virtually unlimited, but making them larger than, say, 5 lines, will result in more empty space in the tiles on average, as more tiles will show up that have a smaller TOC to show.

Below is a screenshot of a folder with some dummy Word documents (I had some fun inventing titles) representing a mix of different documents with a TOC of 1 to 12 entries each.

Screenshot of the test folder:

The TOC inside each document is displayed in yellow (only a single level, H1 let's say - I was not interested in displaying complex title structures). What is displayed is in fact the Info/comments field of the Word document - which DO automatically maps to the "description" and "userdescription" columns (I used the latter). The TOC is properly listed because the vba-macro adds a CR/LF after each TOC entry. The comments are put there by a vba macro in Word (which is stored centrally for all Word documents in the normal.dotm file).

Notice that DO does not support adding CR/LF in a multi-line dialog field - but it displays them properly if they are there already. If you would edit the description via DO's metadata editor or via a scripted dialog, then save the comment in DO, everything after the first CR/LF will be lost. (Of course: there's no reason to edit it outside of Word). The macro also puts an incremental number in front of each entry, and for every entry larger than 5 it adds a small triangle after the last visible subject (the location of the small triangle(s) - line 5 in this case - can be adapted in the Word macro). With one triangle per non-displayed subject you can instantly see how many subjects are out of sight, and you just need to over the mouse over the tile to instantly see the rest).

Here is a screenshot with the mouse hovering over the second document:

As you can see, all header subjects now appear in the Info tip. There is a setting in DO to expand the tile when you click on it though - but that tile then overlaps the tile underneath it, until you click away from it... But I found the Info tip mechanism more convenient (especially after making it appear faster than after the standard 1000 milliseconds in DO - yes, you can tune that one too).

My choice of showing max. 5 subjects is something like choosing the middle road. You will either need to hoover more often, or scroll through more half-empty tiles.

The configuration of the Tiles and Info tip in DO is as follows (tile size is called 'label size' in the preferences):

Now comes a more complicated part. I'll first add a picture collage of actions to take:

(1) In Settings, open the "File types".
(2) Click on Documents, then on Duplicate, give the new file tipe a different name (e.g. Document-Tiles), and click the [+] sign in the 'File Type' tab.
(3) Type docx (or doc, whatever type of Word docs you happen to use).
(4) In the 'Info Tip' tab, add the "{userdesc}" field, optionally adding some make-up code too (I originally used yellow and bold, but later I just defined the {userdesc} field).
(5) Copy the info tip code ({userdesc}) to the 'Tiles Mode' tab as well.
Confirm, so the dialog closes.
(6) Finally, edit the original "Documents" entry and remove the docx extension there (or whatever extension you just configured).

While the setup of the tiles can be limited to folders of your choice (see further on), its actual content and the Info tip are linked to a file type, which is a different mechanism not connected in any way to the setup of the TILES - which is a bit unfortinate. It turns out the 'Documents' and the new 'Document-Tiles' entry must not have overlapping file types either (if you define doc and/or docx, docm in the original 'Documents' type and in the new one, DO may not act as expected).

We're not done yet. We still need to create path formats for localized use in one or more particular folders.

a) Open DO Settings, go to "Folder formats", right-click on "Path Formats" and select "Add" - then select the folder where you want to apply the tiles.

b) In the "Display" tab, select View mode = Tiles.

c) (optional) In the "Hide Filters" tab, put an asterisk in the "Folder names" window if you want to hide any folders in the Tiles view (trust me, this improves the overview if you work with subfolders - and you can always change folders in the folder hierarchy anyway).

d) Finally, at the bottom, check the box to use this configuration as "the default format for all subfolders" - and confirm with the OK-button.

BUTTON
It is recommended to add a small button to DO to switch quickly between the Default view and the Tiles view. I'll not describe how to add a button (see the documentation) but here is a simple code for such a button, in Standard DO script:

@ifset:VIEW=Tiles
Set VIEW=Details
@ifset:else
Set VIEW=Tiles
Show VIEWERCMD=zoom,reset

VB macros
Last but not least: the VB macro I use in Word (via Developer - Visual Basic - and creating a new module for the "normal" template - you can find further documentation on the web).

'=============================================
' MACROS TO SET DOCUMENT TITLES IN COMMENTS
'=============================================
'2 macros to save a single document:
'The first to use within Word...
Public Sub SaveTitlesThisDocument()
    Dim objDoc As Document
    Set objDoc = ActiveDocument
    Call SaveTitlesToComment(objDoc)
End Sub
'The second to use in a Windows "Send To" shortcut...
Public Sub SaveTitlesThisDocumentAndQuit()
    Dim objDoc As Document
    Set objDoc = ActiveDocument
    Call SaveTitlesToComment(objDoc)
    Application.Quit
End Sub

'2 macros to save titles for all documents in a folder:
'The first to use within Word...
Public Sub SaveTitlesThisFolder()
    Call SaveTitlesToCommentThisFolder
End Sub
'The second to use in a Windows "Send To" shortcut...
Public Sub SaveTitlesThisFolderAndQuit()
    Call SaveTitlesToCommentThisFolder
    Application.Quit
End Sub
'Subroutine used by the multi-document macros
Public Sub SaveTitlesToCommentThisFolder()
    Dim fileDirectory, vFile
    Dim objDoc As Word.Document
    fileDirectory = ActiveDocument.Path
    If ActiveDocument.Saved = False Then ActiveDocument.Save 'Save current document first
    Application.ScreenUpdating = False 'Prevent screen flickering
    vFile = Dir(fileDirectory & "\*.doc*")
    Do While vFile <> ""
        Set objDoc = Documents.Open(fileDirectory & "\" & vFile)
        Application.StatusBar = fileDirectory & "\" & objDoc.Name 'Show in status bar where we are...
        Call SaveTitlesToComment(objDoc)
        objDoc.Close
        vFile = Dir
    Loop
    Application.ScreenUpdating = True
    Application.StatusBar = False 'Return control of status bar to Word
End Sub

'The core logic for all previous macros, to put titles into the comments field
Public Sub SaveTitlesToComment(ByRef objDoc As Word.Document)
    Dim rng As Word.Range
    Dim arrHeadings As Variant
    Dim strComment As String, strText As String
    Dim intItem As Integer, intLevel As Integer
    Set rng = objDoc.Content
    strComment = ""
    stopNumbering = False
    suspendNumbering = False
    With objDoc
        Set rng = .Content
        If .BuiltInDocumentProperties("Comments").Value <> "" Then
            .BuiltInDocumentProperties("Comments").Value = ""
        End If
        arrHeadings = .GetCrossReferenceItems(wdRefTypeHeading)
        For intItem = LBound(arrHeadings) To UBound(arrHeadings)
            'Get the text and the level
            strText = Trim$(arrHeadings(intItem))

            'Prepend 'real' titles with an incremental number:
            strText = CStr(intItem) & "-" & strText

            'Directory Opus tiles view shows first 5 titles, so add an indication
            'if there are more titles to follow (real or not real ones):
            If intItem = 5 And UBound(arrHeadings) > 5 Then
                Dim strFF As String: strFF = " "
                Dim i As Integer
                For i = intItem To UBound(arrHeadings) - 1
                    'We add as many tokens as there are unvisible entries...
                    strFF = strFF & ChrW(9660)
                Next
                strText = strText & strFF
            End If
            strComment = strComment & strText & vbNewLine
        Next intItem
        If strComment = "" Then
            'For some reason, non-empty documents keep asking to be saved
            'even if no titles were found (empty strComment). So we set
            'the Saved parameter explicitly to True to avoid unnecessary saving:
            .Saved = True
        Else
            .BuiltInDocumentProperties("Comments").Value = strComment
            .Saved = False
            .Save
        End If
    End With
End Sub

SendTo shortcuts
I think this is really the last thing I did: I added two shortcuts to the windows context menu, that allow me to right-click on a document tile and choose either to rebuild the titles of that document, or to rebuild the tiles for all documents in the same folder. This uses two macros that are included above in the VBScript.

You create two shortcuts in the right location - for windows 10 this is:

C:\Users\berna\AppData\Roaming\Microsoft\Windows\SendTo

A shortcut e.g. named "Renew Titles for this Doc" must contain the following command in the "Target" field:

"C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE" /mSaveTitlesThisDocumentAndQuit

Adapt the path if needed.

The second shortcut, e.g. "Renew Titles for the entire folder" contains the same command but with another macro at the end:

/mSaveTitlesThisFolderAndQuit

You should then find both in the context menu:

That's it.

Some suggestions

  1. Dynamic tile size as an option would be great (but difficult to implement: the text should somehow determinate how big a tile should be). The way I see it: I remember some users in the past asked if the description column or even the filename column could be more dynamic, wrapping text if it does not fit within the column width. To me, tiles offered this kind of solution. In fact I once used a tiles view which is twice as wide as the ones used here, and only 2 lines high - which let me see all ebooks or other files in a folder with full descriptions underneath the file names. Those are workarounds though.

  2. DO could probably support preserving the CR/LF when they occur in a multi-line dialog field, rather than cutting off everything after the first CR/LF. I don't know why that would not be possible - it can certainly and correctly show comments that include such line breaks. This is not needed for the current use case - but more in general I do edit usercomments often, and this issue is a serious limitation when using the Dialog function (multiline edit field).

2 Likes

That is a good, well-thought-out idea. However, GPs have the 'not invented here' syndrome, so I suspect they will not read it. They have all these new killer features in DO 13. Yet, they still have a user interface that looks like it's from the 1980s. It certainly doesn't encourage new users to fall in love with the program or quickly discover its significant features, especially those they have recently added. They need someone experienced in interface design who can provide the overall look and feel of the program. At present, DO appeals primarily to nerds. Yet, I feel with a new interface, it could become a new killer app. A case in point is the Windows terminal.
As you know, many people have done alternative versions with slightly tweaked interfaces, and then we had Microsoft trying to tell everyone that Powershell was the "duck's guts". However, when Google created 'Warp', people started to ask why Microsoft didn't think of this. There is a famous Japanese Quote, "It is said that fish do not see water, nor do Polar bears feel the cold", and I am afraid, despite all GP technical innovations, that if they continue to rely on Microsoft APIs, they will continue to be comfortable in the 'Maya' that Microsoft has created for them.

1 Like

It's a guide on how to do things, which you can do already. We don't need to add anything to make this possible; it already is. Or have I missed something? Where is all this criticism coming from?

If you have constructive suggestions about how to improve the interface, please share them (in a thread for each idea, so we can keep track of the different ideas on our to-do list).

1 Like

I don't remember how long I've been using Dopus, but more than 10 years, yes. I've read this forum and I've read every comment that is made here. There are times when I've wanted to comment when people criticize but I haven't done so in order not to start problems and waste time in discussions that aren't worth it. Maybe my opinion doesn't count but I'm tired of this type of people who criticize everything. If you don't like this software then don't use it!!!. I'm a retired programmer, I've made contributions in various internet forums, I was the creator of winstyle for Windows XP in Spanish. I have this software and almost never, except for 1 or 2 occasions when I asked for help, in the end I almost always solved it myself. If you're not going to contribute anything, don't criticize and let the people who have provided us with this valuable tool work, which I know many of you here wouldn't change for anything. You talk about nerds, maybe you are the nerd because I imagine you want transparencies and things like that, you talk about Windows APIs, well my dear, that is what is on the market, the market is dominated by Microsoft and you have to put up with it or we have to put up with it, there is a word called productivity and I think you don't understand that and this program gives it to you, so if you don't like it, DON'T USE IT.

Fish, it seems, really do discover water last. It's not my job to make people see The most deluded people are those who ignore what they already know https://www.youtube.com/watch?v=7eC8u3_bBDg.

I love Directory Opus, but remember, I am a child of the 1960s, and a lot has changed. As an Australian, I want GP Software to become the go-to product for file management, but I don't want to design a new GUI for the program. That is not my job, and as one can see from the amateurish user templates, it takes a rare, very talented person to do such a task.

Be aware that this post is still unfinished (as long as I did not remove the "[UNDER CONSTRUCTION]" line at the top). Because I published it by accident, asked to put it back in my drafts, but apparently it is already public.

I agree with those who say DO is for geeks. It is certainly for that reason that it takes a lot to document things that are more than just a script or a button. But in the end, it is worth it.

Indeed, most tools that aren't "for geeks" won't let you change much at all, which is why their UIs are so much more simple. :slight_smile:

(Or in some cases, you can change them but have to do it via the registry, which is even more complex and "geeky" than dealing with a config UI.)

1 Like

"If you need a manual, the interface has failed.":

  • Although this isn't always true, it highlights the significance of intuitive design. GP needs to identify the features of DO that differentiate it from its competitors. Once these unique features are recognized, they should be prominently displayed on the interface (GUI). However, the selected highlights mustn't be simply gimmicks; users seek program features that genuinely save them time. These features must be effectively implemented and easily found.

The out-of-the-box GUI is vital, as it sets your product apart. It is GP's 'battle cry'. I've noticed that many of DO's exceptional features are often hidden, and discovering their value can take years, typically by coincidence or hours of tinkering. Honestly, the GUI could be much better, in my humble opinion.

I am staying out of the Australia discussion.
@Jon and @Leo and others can reply better than I can.
I really am NOT ! Sorry !

I liked this post !
It made me think quite alot.
I will not be using this idea in the elegant form that @Bennjamin has shown us, but I very much thank him for this post.

Clipboard Copy and Paste still works fine for me.
PDFs are also of interest to me. It is not hard to to create PDF bookmarks.

In my humble opinion with first thoughts, User Description may not be the best place for this. It would be good to have the ability to keep this file internal, something that ExifTool can find.

1 Like

In reply to @David : I agree with the usefulness of "file internal" storage. I fact, for the Word documents, it is internal - and it happens to show up via Directory Opus' description & userdescription fields, apparently because they implemented this link with Word docs.

Likewise, for media files (at least mp3, mp4) DO links with its internal comment field.

For PDF it is different: I need to use DO's 'Subject' field instead (which maps to the PDF Subject field) - in which case it is, again, file-internal storage, I can copy those files on a non-NTFS drive (as a Windows user) and they retain their info.

In many other cases, DO simply falls back either upon 'NTFS comments' or description.ion files, for which I've always been using the following set-up:

Copy settings / Metadata:

Metadata:

So I let DO always copy descriptions (backups etc), I demand a warning if it cannot be copied, I demand to save internal whenever possible, and I disabled fall-back to description.ion files (so NTFS comments are always used on my system).

With these settings, when the backup location is also NTFS, nothing will be lost.

PS. I suspect a bug in DO: I've found that the setting "Save descriptions to internal file metadata if possible" got disabled multiple times (also again when I went into this setting to take this screenshot) - there is probably something that resets it but I have no idea what it is - certainly not me during sleepwalking. Maybe that's something to report (@Leo ?)

Word supports custom metadata through ActiveDocument.CustomDocumentProperties. And yes, ExifTool can locate this metadata in the XML section! :slight_smile: