Closed huwcbjones closed 5 years ago
@huwcbjones I faced similiar issue. You might want to try my fork of docx-mailmerge where you can pass any data type and it will get replaced correctly. Also, it supports attributes with spaces inside, a datetime
type, which you can customize from within Word (i.e. MERGEFIELD "Date" \@ "dd/MM/yy" \* MERGEFORMAT
), etc.
Can't merge ints without wrapping each int in
str()
Expected Behaviour
Library converts variable to string representation and merges that instead.
Current Behaviour
Library raises
AttributeError
when merging a type that is not a string.Possible Solution
Possible fix in PR #65
Steps to Reproduce (for bugs)
Context
Trying to merge numerical types (ints/floats) without having to wrap each one in
str(number)
Your Environment