Skip to content

chigges/doctemplatex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DocTemplateX

A tkinter GUI app that replaces merge codes in a word document with user input. Effectively allowing you to create templates with defaults out of .docx files.

Installation

From Release

Download the latest release on the 'releases' tab.

From Source

To install the project, clone the repository and enter the project directory:

git clone https://github.com/CtrlAltDelight/word-doc-replacer
cd word-doc-replacer

To install dependencies, you can use conda or pip:

Conda

Then, create a conda environment from the environment.yml file and activate it:

conda env create -f environment.yml
conda activate word-replacer

If you prefer not to use conda, you may use any other package manager to install the dependencies listed in environment.yml.

Pip

pip install -r requirements.txt

Other

The main two dependencies for this project are tk and python-docx if you want to install them individually.

Running the program

To run the program:

python3 replacer.py

Usage

Put merge codes in your word document for things you need to replace often in documents.

These codes are formatted like this: {FieldName|DefaultValue}

When you run the program and select a .docx file, it will scan for merge codes. The program will populate each field with the default value and prompt you to change them. Once you have made necessary changes, you can save the file as a new document.

Voila! You've just replaced merge codes in a word document!

Example Use

Let's say you're a Jedi trying to recruit young force sensitives in your efforts against the dark side.

You could create a document like this:

Dear {Recipient|Luke}

We want to talk to you about {Subject|the Force}. Do you still live on {Planet|Tatooine}?

Sincerely,
{Sender|Uncle Ben}

This way, Uncle Ben can use this formatted document to make personalized messages to many young force sensitives and switch out the key components of the message.

Contributing

This project is still in development. Here are some things I plan to add:

  • Add support for more file types like .pages, .txt, .pdf, etc.
  • Add support for more complex mail merge codes, such as loops and conditionals
  • Make the GUI more user-friendly (add tooltips, better error messagest, etc.)
  • Arrange the GUI elements in a more satisfying way
  • Add a progress bar for long documents
  • Add feature to preview document before saving

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages