iulica / docx-mailmerge

Mail merge for Office Open XML (docx) files without the need for Microsoft Office Word.
MIT License
55 stars 7 forks source link

Labels/Single Page with Multiple Records (Next Records) #12

Closed dwasyl closed 11 months ago

dwasyl commented 1 year ago

I'm working to generate some mailing labels via docx-mailmerge2, generally these have a single design followed by a "next record" flag and that way you can generate 5-20 labels on a single sheet. While there seem to be some tests for next record, the document templates I've been using don't seem to work.

Is there special handling required for these situations or knowing how to detect it?

iulica commented 1 year ago

Hi, which version have you used ? The released one doesn't contain the NEXT field implementation. Just lazy on my part on the release cycle. If you try with the github version by installing it directly with pip install git+https://github.com/iulica/docx-mailmerge

Let me know if this works for you and I will make a release afterwards.

dwasyl commented 1 year ago

Okay tried that - It seems to generate one page of labels for any given data (and includes the <<Next Record>> label with each subsequent label. The data provided is in the same structure as how I provide it for doing multiple documents combined (which always works no problem).

Thoughts?

iulica commented 1 year ago

Hmm, can you make a short example I can test ? I don't quite understand what you mean.

dwasyl commented 1 year ago

Sample Labels.docx

Sure, here's a simple label sheet template I've been trying to use. Or did you mean code as well?

iulica commented 1 year ago

well, if you can include the code, it's much easier for me to test. Otherwise I have to create my own sample.

iulica commented 1 year ago

Here is a test I made with 5 rows of data. There is something wrong with your template I believe. I opened the template in Word and did the mailmerge manually and the result is similar (There is a slight problem, the docx-mailmerge doesn't remove the remaining labels on the last page, it is known and I don't have an easy solution but is also not a problem in my opinion).

out_docx_mailmerge.docx out_word_mailmerge.docx test_next.xlsx

dwasyl commented 11 months ago

@iulica Okay, I tried the live branch again and it seems to be working okay for labels. Is there chance of a new release happening for others?

iulica commented 10 months ago

I am currently in vacation and will make a release as soon as I return, in 1-2 weeks from now. Thanks for testing

iulica commented 8 months ago

@dwasyl I have just released the 0.6.3. Sorry that it took so long.