You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.
I'm new to this module. I tried exactly your example but it says below exception:
Traceback (most recent call last):
File "/Users/mac/Downloads/BBEditRunTemp-test.py", line 6, in
document.write('output.docx')
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/mailmerge.py", line 121, in write
for zi in self.zip.filelist:
AttributeError: 'NoneType' object has no attribute 'filelist'
The code is here:
from mailmerge import MailMerge
with MailMerge('input.docx') as document:
...
document.merge(field1='docx Mail Merge',
field2='Can be used for merging docx documents')
document.write('output.docx')
The text was updated successfully, but these errors were encountered:
Instead of using with to open the existing document, use MailMerge function to read the file object.
To fix the error use the below code:
from mailmerge import MailMerge document = MailMerge('input.docx')
document.merge(field1='docx Mail Merge', field2='Can be used for merging docx documents')
document.write('output.docx')
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm new to this module. I tried exactly your example but it says below exception:
Traceback (most recent call last):
File "/Users/mac/Downloads/BBEditRunTemp-test.py", line 6, in
document.write('output.docx')
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/mailmerge.py", line 121, in write
for zi in self.zip.filelist:
AttributeError: 'NoneType' object has no attribute 'filelist'
The code is here:
from mailmerge import MailMerge
with MailMerge('input.docx') as document:
...
document.merge(field1='docx Mail Merge',
field2='Can be used for merging docx documents')
document.write('output.docx')
The text was updated successfully, but these errors were encountered: