View Single Post
 
Old 02-05-2021, 09:44 PM
SamDsouza SamDsouza is offline Windows 10 Office 2013
Advanced Beginner
 
Join Date: Aug 2019
Posts: 71
SamDsouza is on a distinguished road
Default

Quote:
You can't do that in advance, since you don't know beforehand, what Style names, fonts etc. are in use and how long their names are. Moreover, if the output is generated using proportional fonts, there is never a 1:1 relationship between the character counts and their widths. If you use tabs for the separators, none of this will be a problem; you can simply adjust the tab-stops to suit once the output is generated. Better still, if you convert the output to a table, Word will handle the alignments automatically for you.
Paul. Your point well taken
In this case the output is standard with different style, font names and size etc
I was thinking on
Total how may Styles are there in the Word
Which Style (name) has maximum length. So let us keep the Len of the Style (name) which has maximum characters or letters. Same case for Font name, Alignment etc

On Beforehand
Knowing the LEN of Style(name) , LEN(Font.name), LEN(Alignment) which has max characters, keep that as Const and derive function for equal spacing between values of returned objects.

Putting exact logic for a function is really difficult for me.

Do we have vbTabstop like PRINT TAB(30); in VBA ?


For each document no will know beforehand what style font name etc have been used.
once running the macro shall give the details
Therfore i used Textbox to get the details of Returned value of objects.
This is for neat representation ie why exact spacing required
SamD
Reply With Quote