Generation Settings

中文

Sheet to Doc is a powerful tool that automatically writes Excel, CSV, JSON, JSONL data into docx format Word templates, converting them into Word documents in batches.

Building on the basis of mail merge, this tool has developed more features, such as custom file names, custom file paths, embedding images, and so on.

Note

This page is quite long, we recommend that you browse this page with the Table of Contents on the left side of the page to help you understand the page structure.

Generation Modes

Mode 2: Generate One Word Document for All Data

  • All Excel data will be written into the Word template in a loop, inside the Word document, the data will be repeatedly generated according to the placeholder design of the template, and finally a single Word document will be generated.

  • In this mode, you must use the loop placeholder 1 {#data}..{/data} in the template, otherwise it will cause an error. Learn how to use loop placeholder 1 in Template Preparation.

Filename Settings

Sheet-to-Doc provides flexible filename customization functionality, allowing you to set the filenames of the generated documents according to your needs.

Filename Generation Methods

You can choose from two filename generation methods:

  1. Default Filename: The system automatically generates filenames in the following format:

    • Mode 1: sheet_to_doc_R_{row_number}_{timestamp+random_number}.docx

    • Mode 2: sheet_to_doc_All_{timestamp+random_number}.docx

  2. Custom Filename: You can customize the filename format according to your needs, including prefix, middle content (from titles in Excel data), and suffix.

Custom Filename Settings

When selecting the custom filename method, you can set the following options:

  • Prefix: The beginning part of the filename, which can be any text or empty.

  • Middle (from Excel data titles): Select a column from the Excel data as the middle part of the filename. If it is a complex data structure, the middle dropdown menu will be disabled, and only simple data structures are supported.

  • Suffix: The ending part of the filename, which can be any text or empty.

The final filename format is: [Prefix][Middle][Suffix].docx

Custom filenames have the following limitations:

  • The total length of prefix, middle, and suffix cannot exceed 200 characters.

  • Special characters such as /, \, *, ?, <, >, | are not allowed in filenames. They will be automatically replaced with underscores _.

  • Spaces in filenames are not allowed. They will be automatically replaced with underscores _.

Filename Preview

The system will use the first row of data to generate a real-time filename preview, helping you confirm whether the filename format meets your expectations. The preview format is: [Prefix][Value from corresponding column in first row data][Suffix].docx

Custom Filename Examples

Here are several actual examples of custom filenames to help you better understand how to use this feature:

Example 1: Using Name as Filename

  • Prefix: Employee_

  • Middle (from data): Select the column containing employee names (e.g., the value in the “Name” column is “Zhang San”)

  • Suffix: _Profile

  • Generated filename: Employee_Zhang San_Profile.docx

Example 2: Using ID as Filename

  • Prefix: Contract_

  • Middle (from data): Select the column containing contract IDs (e.g., the value in the “Contract ID” column is “CON2024001”)

  • Suffix: Empty

  • Generated filename: Contract_CON2024001.docx

Example 3: Using Date and Name Combination

  • Prefix: Report_

  • Middle (from data): Select the column containing report dates (e.g., the value in the “Date” column is “2024-05-20”)

  • Suffix: _Zhang San

  • Generated filename: Report_2024-05-20_Zhang San.docx

Example 4: Using Product Name and Version Number

  • Prefix: Empty

  • Middle (from data): Select the column containing product names (e.g., the value in the “Product Name” column is “SheetToDoc”)

  • Suffix: _v1.2.0

  • Generated filename: SheetToDoc_v1.2.0.docx

“Last modified by” Settings

Sheet-to-Doc provides a “Last modified by” feature that allows you to customize the author information displayed in the generated Word documents.

Options

  • Use default value: “Sheet-to-Doc Batch Generated, https://s.wtsolutions.cn/sheet-to-doc.html”

  • Pro Feature Same as “Last Modified By” in template file

  • Pro Feature Custom value: Enter a custom author name or identifier.

Examples

Example 1: Using Company Name

  • Last modified by: ABC Company

  • Result: All generated documents will show “ABC Company” as the last modifier.

Example 2: Using Department Name

  • Last modified by: Human Resources Department

  • Result: All generated documents will show “Human Resources Department” as the last modifier.

Example 3: Using Specific Author Name

  • Last modified by: John Doe

  • Result: All generated documents will show “John Doe” as the last modifier.