Table width problems on narrative export to rtf (word doc)
Posted: 01 Aug 2014 21:58
I think this has similarities to post Narrative reports - tabs (7652)
http://www.fhug.org.uk/forum/viewtopic. ... ble#p33804
but as it is from 2007 I thought I should raise a new post, and my fix below might help with the original problem.
This is just an observation, there might be a FH fix, but this external fix might be of help to others:
I have run various narrative reports and where there is a numbered list, say children it gives e.g.
When I export to RTF > Word the list is in the form of a table, which ends up like this: The problem is that the table column has a fixed width less than the width of the characters. An easy manual fix, but very time consuming and fiddly.
I found the following word macro that Autofits the contents of all tables in a document. For my reports it worked fine, but it is rather a sledgehammer and in some situations it may upset other things.
If you change wdAutoFitContent to wdAutoFitWindow, it will autofit the full width of the document, whereas wdAutoFitContent leaves the table in its original indented position.
P.S. Not sure if my 2 [img]s have worked, so I entered some of it manually. Is there anything special to inserting pictures in the forum. I tried onedrive, googledocs, jpg, png. [edit, the picture upload is now fixed] I followed the Can I post images? on http://www.fhug.org.uk/forum/faq.php#f3r3. Also I can't get the [topic][/topic] to work or [attachment=][/attachment]
http://www.fhug.org.uk/forum/viewtopic. ... ble#p33804
but as it is from 2007 I thought I should raise a new post, and my fix below might help with the original problem.
This is just an observation, there might be a FH fix, but this external fix might be of help to others:
I have run various narrative reports and where there is a numbered list, say children it gives e.g.
When I export to RTF > Word the list is in the form of a table, which ends up like this: The problem is that the table column has a fixed width less than the width of the characters. An easy manual fix, but very time consuming and fiddly.
I found the following word macro that Autofits the contents of all tables in a document. For my reports it worked fine, but it is rather a sledgehammer and in some situations it may upset other things.
Code: Select all
Sub AutoFitAllTableAutoFitContent()
' from http://www.experts-exchange.com/Database/MS_Access/Q_22964541.html but amended wdAutoFitWindow to wdAutoFitContent.
Dim tbl As Table
For Each tbl In ActiveDocument.Tables
tbl.AutoFitBehavior wdAutoFitContent
Next tbl
End SubP.S. Not sure if my 2 [img]s have worked, so I entered some of it manually. Is there anything special to inserting pictures in the forum. I tried onedrive, googledocs, jpg, png. [edit, the picture upload is now fixed] I followed the Can I post images? on http://www.fhug.org.uk/forum/faq.php#f3r3. Also I can't get the [topic][/topic] to work or [attachment=][/attachment]