I am fetching information from an Access DB and populating this data to a Word doc. The data is for a hard cover phone directory of over 30,000 people. I am formatting the word document on the fly from within VB, but I am having trouble with one crucial measurement.
I need to find a way to get the actual dimensions of a string of text. I'm not talking about the length of a string in characters [e.g "len(myString)" ], I am wanting to know how many points that string will occupy when printed on the page. This value will need to change dynamically depending upon what font is being used, as well as the font size. If I have that calculation and it's accurate, I can properly format the rest of the document before sending the data for output.
I feel like I am close in my efforts, but I am getting nowhere with this. Before the formatting code occurs, I am opening a recordset and grabbing one phone number, which I'm using to perform the calculation. This is what I am currently using to calculate this measurement:
sngLength = InchesToPoints(Len(Right(rs!Phone1,8)))
Does anyone have a clue? Am I way off track? Can I simplify this process in any way?
Any help would be appreciated!!
Thanks in advance.
I need to find a way to get the actual dimensions of a string of text. I'm not talking about the length of a string in characters [e.g "len(myString)" ], I am wanting to know how many points that string will occupy when printed on the page. This value will need to change dynamically depending upon what font is being used, as well as the font size. If I have that calculation and it's accurate, I can properly format the rest of the document before sending the data for output.
I feel like I am close in my efforts, but I am getting nowhere with this. Before the formatting code occurs, I am opening a recordset and grabbing one phone number, which I'm using to perform the calculation. This is what I am currently using to calculate this measurement:
sngLength = InchesToPoints(Len(Right(rs!Phone1,8)))
Does anyone have a clue? Am I way off track? Can I simplify this process in any way?
Any help would be appreciated!!
Thanks in advance.