I'm writing some software that takes a Microsoft Word document, replaces variables inside, then prints the final document onto an ID card. The document has limited space and must fit on a single page, but needs to include the person's photo, as well as first and last names, which can get quite long
The document is laid out inside of a table so common elements remain in the same spot (e.g. barcode is always at the bottom, but when I put in a really long first or last name, the text wraps and pushes everything onto two pages, which I don't want.
There's an option to fit the text to the table, but that changes the font width (not the font size), so long names look horizontally squashed, and if the user has a short name (like Leo), the whole name is spaced out across the page (so L is on the left, E in the middle, and O on the right)
(The blue box is where the logo will go, the green box, the photo)
Is there a way to fit the text into the table without causing the text to "justify", or cause the font to shrink horizontally?
EDIT: I'd just be happy to stop the justification, and leave the font squished.
EDIT 2: I've tried just about everything, save running some kind of macro that measures the text and shrinks it down (too complex, not worth it for only about six out of the 1000 cards I need to produce). My eventual compromise (not answer, I'm still looking for one!) was to set the row height to be exact (not "at least") so when new text gets entered, it's truncated. Because we have the photo and user's ID (e.g. Leo Superlongfirstnamethatdoesn'texist's user ID would be something like SUPELEO1), that's enough for positive ID.
For completeness, I've tried aligning text using both paragraph and cell alignment, creating another table within the cell (so I could set one as "auto width" with "fit text" enabled and the other, to fixed width, without fit-text. Turns out auto-width doesn't work with a table inside a cell. So I'm all out of ideas!