Specify folder to save the document in

When you require your documents to be saved automatically – using document naming, you also need to decide on which folder to store it. A significant feature of 4TOPS Document Creation is that VBA procedures created with it support automatic creation of a folder automatically based on dynamically determined folder structure.

Having a dynamically determined folder structure is great:

  • It makes it easy to find documents. It gives logical entry points, e.g. by customer and the folder contains fewer documents making it easy to find the one you are looking for.
  • Consistent use of folders makes it easy to understand for all users involved
  • Saves time having to 1. manually create the folder and 2. select the folder to store the document in.

In the example above functions ReplaceIllegalCharacters and ControlValue are used which are explained in document naming so I will not repeat them here.


strFolder = CodeProject.Path & "\Documents" & "\" & _
ReplaceIllegalCharacters(ControlValue(![CustomerID]), "_")

When defining the folder expression you will start by selecting a root folder under which documents are store, as said preferably organized in subfolders. When you choose a root folder make sure it is not under \Documents that being a private folder not accessible to your co-workers. Anyway, you can change the VBA code where you set the root folder easily later.