473,797 Members | 2,934 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I get height of text block?

I have a client that I wrote an MS Access app for quite a few years ago
where they need to know the height in inches of a block of text for billing
their customers. The MS Access app opens Word in the background, makes some
settings (font, font size, margins, etc.) and gets the height. It's all
worked quite well for 3 or 4 years.

However, the whole thing is going to be redone for use in browsers in
asp.net with vb.net. We want to eliminate the need to use Word for this. I'd
like to write a function in vb.net for this. The whole thing is going to be
run on both Windows and Mac machines. I found some info here:

http://www.experts-exchange.com/Prog....NET/Q_2182000
8.html

but I'm not sure it's the correct approach. I was hoping someone
could point me in the right direction.

Thanks,

Keith

Jun 27 '08 #1
12 1838
"Keith G Hicks" <kr*@comcast.ne tschrieb
I have a client that I wrote an MS Access app for quite a few years
ago where they need to know the height in inches of a block of text
for billing their customers. The MS Access app opens Word in the
background, makes some settings (font, font size, margins, etc.) and
gets the height. It's all worked quite well for 3 or 4 years.

However, the whole thing is going to be redone for use in browsers
in asp.net with vb.net. We want to eliminate the need to use Word
for this. I'd like to write a function in vb.net for this. The whole
thing is going to be run on both Windows and Mac machines. I found
some info here:

http://www.experts-exchange.com/Prog....NET/Q_2182000
8.html
Login required. Anyway, the size of the text on which device on which
machine using which dpi settings and which font do you want to
calculate? I won't be able to give an ASP.Net specific answer but I
think the questions must be asked first.
but I'm not sure it's the correct approach. I was hoping someone
could point me in the right direction.

Armin

Jun 27 '08 #2
If you scroll down to the bottom end of the page in that URL, you'll see
answers. Login is only required for the "expert's" answers. There are other
answers that anyone can see below all the advertising. I'm not a subscriber
either and I get answers from there quite often.

Also, I should have mentioned that the font and other settings are specific
to get the length. It's not dependent on what the text comes in as. In the
Word code we're using now, I set the font to Arial 7, single spaced, 0
spacing before and after paragraphs, text width is set to 1.5 inches by
setting page size and margins. Then I can get the exact height of the text
in inches. That's pretty much wath I need to do in vb.net but without Word.
Height will be based on the same settings font, text width and paragraph
settings. In this respect it's a bit different than the question the user
had on the URL I included.

Keith

"Armin Zingler" <az*******@free net.dewrote in message
news:uA******** ******@TK2MSFTN GP06.phx.gbl...
"Keith G Hicks" <kr*@comcast.ne tschrieb
I have a client that I wrote an MS Access app for quite a few years
ago where they need to know the height in inches of a block of text
for billing their customers. The MS Access app opens Word in the
background, makes some settings (font, font size, margins, etc.) and
gets the height. It's all worked quite well for 3 or 4 years.

However, the whole thing is going to be redone for use in browsers
in asp.net with vb.net. We want to eliminate the need to use Word
for this. I'd like to write a function in vb.net for this. The whole
thing is going to be run on both Windows and Mac machines. I found
some info here:
http://www.experts-exchange.com/Prog....NET/Q_2182000
8.html

Login required. Anyway, the size of the text on which device on which
machine using which dpi settings and which font do you want to
calculate? I won't be able to give an ASP.Net specific answer but I
think the questions must be asked first.
but I'm not sure it's the correct approach. I was hoping someone
could point me in the right direction.


Armin

Jun 27 '08 #3

why not solve the real problem ... why do they need the 'hieght' of a text
block? I assume it is for reporting and not 'Your text hiegh is 2.4 inches'
.... are you dynamically changing a report, margins, locations ... based on
this hieght? Answer that question first, and design accordingly.

Otherwise, I am not sure how you would/could go about this ... build an
label set to auto size ... fill it with text ... adjust the width ... get
the hight?

Jeff.
"Keith G Hicks" <kr*@comcast.ne twrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
If you scroll down to the bottom end of the page in that URL, you'll see
answers. Login is only required for the "expert's" answers. There are
other
answers that anyone can see below all the advertising. I'm not a
subscriber
either and I get answers from there quite often.

Also, I should have mentioned that the font and other settings are
specific
to get the length. It's not dependent on what the text comes in as. In the
Word code we're using now, I set the font to Arial 7, single spaced, 0
spacing before and after paragraphs, text width is set to 1.5 inches by
setting page size and margins. Then I can get the exact height of the text
in inches. That's pretty much wath I need to do in vb.net but without
Word.
Height will be based on the same settings font, text width and paragraph
settings. In this respect it's a bit different than the question the user
had on the URL I included.

Keith

"Armin Zingler" <az*******@free net.dewrote in message
news:uA******** ******@TK2MSFTN GP06.phx.gbl...
>"Keith G Hicks" <kr*@comcast.ne tschrieb
I have a client that I wrote an MS Access app for quite a few years
ago where they need to know the height in inches of a block of text
for billing their customers. The MS Access app opens Word in the
background, makes some settings (font, font size, margins, etc.) and
gets the height. It's all worked quite well for 3 or 4 years.

However, the whole thing is going to be redone for use in browsers
in asp.net with vb.net. We want to eliminate the need to use Word
for this. I'd like to write a function in vb.net for this. The whole
thing is going to be run on both Windows and Mac machines. I found
some info here:

http://www.experts-exchange.com/Prog....NET/Q_2182000
8.html

Login required. Anyway, the size of the text on which device on which
machine using which dpi settings and which font do you want to
calculate? I won't be able to give an ASP.Net specific answer but I
think the questions must be asked first.
but I'm not sure it's the correct approach. I was hoping someone
could point me in the right direction.


Armin


Jun 27 '08 #4
*WRONG* ASSUMPTION!
I STATED THE *REAL* PROBLEM.
I NEED THE HEIGHT OF THE BLOCK OF TEXT.
IT'S FOR A NEWSPAPER (not that I should have to say that really).
THEY NEED TO KNOW HOW MANY INCHES TALL THE TEXT IS FOR EACH ADVERTISEMENT
WHEN SET TO ARIAL 7 POINT, ETC.
IT'S FOR BILLING PURPOSES.

Keith

"jeff" <jhersey at allnorth dottt comwrote in message
news:#r******** ******@TK2MSFTN GP04.phx.gbl...
>
why not solve the real problem ... why do they need the 'hieght' of a text
block? I assume it is for reporting and not 'Your text hiegh is 2.4
inches'
... are you dynamically changing a report, margins, locations ... based on
this hieght? Answer that question first, and design accordingly.

Otherwise, I am not sure how you would/could go about this ... build an
label set to auto size ... fill it with text ... adjust the width ... get
the hight?

Jeff.
"Keith G Hicks" <kr*@comcast.ne twrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
If you scroll down to the bottom end of the page in that URL, you'll see
answers. Login is only required for the "expert's" answers. There are
other
answers that anyone can see below all the advertising. I'm not a
subscriber
either and I get answers from there quite often.

Also, I should have mentioned that the font and other settings are
specific
to get the length. It's not dependent on what the text comes in as. In
the
Word code we're using now, I set the font to Arial 7, single spaced, 0
spacing before and after paragraphs, text width is set to 1.5 inches by
setting page size and margins. Then I can get the exact height of the
text
in inches. That's pretty much wath I need to do in vb.net but without
Word.
Height will be based on the same settings font, text width and paragraph
settings. In this respect it's a bit different than the question the
user
had on the URL I included.

Keith

"Armin Zingler" <az*******@free net.dewrote in message
news:uA******** ******@TK2MSFTN GP06.phx.gbl...
"Keith G Hicks" <kr*@comcast.ne tschrieb
I have a client that I wrote an MS Access app for quite a few years
ago where they need to know the height in inches of a block of text
for billing their customers. The MS Access app opens Word in the
background, makes some settings (font, font size, margins, etc.) and
gets the height. It's all worked quite well for 3 or 4 years.

However, the whole thing is going to be redone for use in browsers
in asp.net with vb.net. We want to eliminate the need to use Word
for this. I'd like to write a function in vb.net for this. The whole
thing is going to be run on both Windows and Mac machines. I found
some info here:
http://www.experts-exchange.com/Prog....NET/Q_2182000
8.html

Login required. Anyway, the size of the text on which device on which
machine using which dpi settings and which font do you want to
calculate? I won't be able to give an ASP.Net specific answer but I
think the questions must be asked first.

but I'm not sure it's the correct approach. I was hoping someone
could point me in the right direction.
Armin


Jun 27 '08 #5

thanks for pointing that out ...

webservice ... use same logic you have today ... install word on the web
server ... if you have control of installations on the web server.

or use the approach outlined in the noted document ... again, wrap it up in
a webservice.

Jeff.

"Keith G Hicks" <kr*@comcast.ne twrote in message
news:OB******** ******@TK2MSFTN GP04.phx.gbl...
*WRONG* ASSUMPTION!
I STATED THE *REAL* PROBLEM.
I NEED THE HEIGHT OF THE BLOCK OF TEXT.
IT'S FOR A NEWSPAPER (not that I should have to say that really).
THEY NEED TO KNOW HOW MANY INCHES TALL THE TEXT IS FOR EACH ADVERTISEMENT
WHEN SET TO ARIAL 7 POINT, ETC.
IT'S FOR BILLING PURPOSES.

Keith

"jeff" <jhersey at allnorth dottt comwrote in message
news:#r******** ******@TK2MSFTN GP04.phx.gbl...
>>
why not solve the real problem ... why do they need the 'hieght' of a
text
block? I assume it is for reporting and not 'Your text hiegh is 2.4
inches'
>... are you dynamically changing a report, margins, locations ... based
on
this hieght? Answer that question first, and design accordingly.

Otherwise, I am not sure how you would/could go about this ... build an
label set to auto size ... fill it with text ... adjust the width ... get
the hight?

Jeff.
"Keith G Hicks" <kr*@comcast.ne twrote in message
news:%2******* *********@TK2MS FTNGP02.phx.gbl ...
If you scroll down to the bottom end of the page in that URL, you'll
see
answers. Login is only required for the "expert's" answers. There are
other
answers that anyone can see below all the advertising. I'm not a
subscriber
either and I get answers from there quite often.

Also, I should have mentioned that the font and other settings are
specific
to get the length. It's not dependent on what the text comes in as. In
the
Word code we're using now, I set the font to Arial 7, single spaced, 0
spacing before and after paragraphs, text width is set to 1.5 inches by
setting page size and margins. Then I can get the exact height of the
text
in inches. That's pretty much wath I need to do in vb.net but without
Word.
Height will be based on the same settings font, text width and
paragraph
settings. In this respect it's a bit different than the question the
user
had on the URL I included.

Keith

"Armin Zingler" <az*******@free net.dewrote in message
news:uA******** ******@TK2MSFTN GP06.phx.gbl...
"Keith G Hicks" <kr*@comcast.ne tschrieb
I have a client that I wrote an MS Access app for quite a few years
ago where they need to know the height in inches of a block of text
for billing their customers. The MS Access app opens Word in the
background, makes some settings (font, font size, margins, etc.) and
gets the height. It's all worked quite well for 3 or 4 years.

However, the whole thing is going to be redone for use in browsers
in asp.net with vb.net. We want to eliminate the need to use Word
for this. I'd like to write a function in vb.net for this. The whole
thing is going to be run on both Windows and Mac machines. I found
some info here:
http://www.experts-exchange.com/Prog....NET/Q_2182000
8.html

Login required. Anyway, the size of the text on which device on which
machine using which dpi settings and which font do you want to
calculate? I won't be able to give an ASP.Net specific answer but I
think the questions must be asked first.

but I'm not sure it's the correct approach. I was hoping someone
could point me in the right direction.
Armin



Jun 27 '08 #6
"Keith G Hicks" <kr*@comcast.ne tschrieb
I set the font to Arial 7, single spaced, 0
Ummm.. isn't the height = 7 points? (=7/72" inch = 0,0972 inches)

Sry, no more time ATM.
Armin
Jun 27 '08 #7
On 28 Mai, 15:09, "Keith G Hicks" <k...@comcast.n etwrote:
I have a client that I wrote an MS Access app for quite a few years ago
where they need to know the height in inches of a block of text for billing
Hi there,

I once did this. We had an application which sized the object
containing some text too small. So the text was out of bound. I
calculated the size of the text and adjusted the size of the object.
You can do this using API calls.

http://www.filesite.org/viewtopic.php?t=1319&highlight=

Michael
Jun 27 '08 #8
Should not run Word from server. I was originally going to do that but
everything I read says that's a very bad thing to do. Apparently all sorts
of problems occur. There's even a page on the MS website where they say that
this should not be done as Word is not designed to be run from the server. I
don't remember where that is but they strongly advise against it.
"jeff" <jhersey at allnorth dottt comwrote in message
news:e#******** ******@TK2MSFTN GP06.phx.gbl...
>
thanks for pointing that out ...

webservice ... use same logic you have today ... install word on the web
server ... if you have control of installations on the web server.

or use the approach outlined in the noted document ... again, wrap it up
in
a webservice.

Jeff.

"Keith G Hicks" <kr*@comcast.ne twrote in message
news:OB******** ******@TK2MSFTN GP04.phx.gbl...
*WRONG* ASSUMPTION!
I STATED THE *REAL* PROBLEM.
I NEED THE HEIGHT OF THE BLOCK OF TEXT.
IT'S FOR A NEWSPAPER (not that I should have to say that really).
THEY NEED TO KNOW HOW MANY INCHES TALL THE TEXT IS FOR EACH
ADVERTISEMENT
WHEN SET TO ARIAL 7 POINT, ETC.
IT'S FOR BILLING PURPOSES.

Keith

"jeff" <jhersey at allnorth dottt comwrote in message
news:#r******** ******@TK2MSFTN GP04.phx.gbl...
>
why not solve the real problem ... why do they need the 'hieght' of a
text
block? I assume it is for reporting and not 'Your text hiegh is 2.4
inches'
... are you dynamically changing a report, margins, locations ... based
on
this hieght? Answer that question first, and design accordingly.

Otherwise, I am not sure how you would/could go about this ... build an
label set to auto size ... fill it with text ... adjust the width ...
get
the hight?

Jeff.
"Keith G Hicks" <kr*@comcast.ne twrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
If you scroll down to the bottom end of the page in that URL, you'll
see
answers. Login is only required for the "expert's" answers. There are
other
answers that anyone can see below all the advertising. I'm not a
subscriber
either and I get answers from there quite often.

Also, I should have mentioned that the font and other settings are
specific
to get the length. It's not dependent on what the text comes in as.
In
the
Word code we're using now, I set the font to Arial 7, single spaced,
0
spacing before and after paragraphs, text width is set to 1.5 inches
by
setting page size and margins. Then I can get the exact height of the
text
in inches. That's pretty much wath I need to do in vb.net but without
Word.
Height will be based on the same settings font, text width and
paragraph
settings. In this respect it's a bit different than the question the
user
had on the URL I included.

Keith

"Armin Zingler" <az*******@free net.dewrote in message
news:uA******** ******@TK2MSFTN GP06.phx.gbl...
"Keith G Hicks" <kr*@comcast.ne tschrieb
I have a client that I wrote an MS Access app for quite a few
years
ago where they need to know the height in inches of a block of
text
for billing their customers. The MS Access app opens Word in the
background, makes some settings (font, font size, margins, etc.)
and
gets the height. It's all worked quite well for 3 or 4 years.

However, the whole thing is going to be redone for use in browsers
in asp.net with vb.net. We want to eliminate the need to use Word
for this. I'd like to write a function in vb.net for this. The
whole
thing is going to be run on both Windows and Mac machines. I found
some info here:

http://www.experts-exchange.com/Prog....NET/Q_2182000
8.html

Login required. Anyway, the size of the text on which device on
which
machine using which dpi settings and which font do you want to
calculate? I won't be able to give an ASP.Net specific answer but I
think the questions must be asked first.

but I'm not sure it's the correct approach. I was hoping someone
could point me in the right direction.
Armin






Jun 27 '08 #9
Thanks Michael. This looks promising. I'll look into it later today.

Keith

"Michael Leithold, WWK" <mi************ ******@googlema il.comwrote in
message
news:f0******** *************** ***********@b1g 2000hsg.googleg roups.com...
On 28 Mai, 15:09, "Keith G Hicks" <k...@comcast.n etwrote:
I have a client that I wrote an MS Access app for quite a few years ago
where they need to know the height in inches of a block of text for
billing
>
Hi there,

I once did this. We had an application which sized the object
containing some text too small. So the text was out of bound. I
calculated the size of the text and adjusted the size of the object.
You can do this using API calls.

http://www.filesite.org/viewtopic.php?t=1319&highlight=

Michael

Jun 27 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2912
by: Secret Guy | last post by:
Because of my experience posting various places over the last couple of weeks: I'm expecting to be greated with hostility for asking about concepts instead of "practical" things, since that has been my experience for years and decades. Maybe I'm projecting hostility. I don't know. How can I ask about theory and concepts without offending people? I'll just continue asking and cross my fingers: According to the 2.1 spec, regarding...
11
2137
by: Chris Beall | last post by:
Here's the problem: http://pages.prodigy.net/chris_beall/Demo/theproblem.html The page contains inline text, then some additional pairs of text which are floated right and left. (This is a transcript of a historical legal document with signatures on the right and witnesses on the left). The 'document' ends with no additional inline text. The background of the entire document should be brown inside a white body, (in this test the body...
2
2724
by: Steve Bottoms | last post by:
Hi, all! Using VB as code-behind in asp.net page... I have a TABLE control which I'm building dynamically. After the table is built, I'm trying to retrieve the HEIGHT property of that table (table.height.value) to be able to dynamically position the next elements on the form. However, this control property is coming back as -0- every time. I also try to get the table height with Javascript after-the-fact (table.style.height), but that...
6
2713
by: Martin Plotz | last post by:
Dear Newsgroup, I would like to have a page with a footer on the bottom of the page with a fixed height. The upper part should have the remaining height. In frames I could achieve this with "*" as height for the upper part - but I would like to do the same with CSS. In Firefox <body style="height:100%"> <div id="main"
11
2575
by: RTrigaux | last post by:
Hello all, I have a page setup with blocs of texts (div with margins, background colors and all). For one of these blocks, I need two columns. Their height is not predictible. The simple CSS for this is a div which contains two divs, using for each of the two position:absolute to set the horizontal dimentions of each columns. (I also tried float, display inline...) The problem is that each time, the two contained divs appear above...
3
4467
by: ianv2 | last post by:
Hi I have a div which contains my local navigation bar, which has a blue background and is next to the content div, at the moment however this blue background colour stops after the unordered list ? I would like the background colour to fill the entrire length of the localnav div How is this achieved with CSS?
1
5167
by: pravinnweb | last post by:
can anyone tell me how to set auto height to outer div that is in green box id "gray-background" it should increase relatively to inner div "smbox" here is the css and html code it should work in FF, IE6 and IE7 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> Employee Listing </TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords"...
1
3602
by: soms2m | last post by:
HELLO ALL, I want to fill the parent window height with respect to the sub window height which is loading using ajax (mootools). For example if the parent window height is normal and the loading child window height is 1200px (saying), when the child window load the height of the parent window changs but the backgorund color which is given 100% not fill the parent window. I have given my example codes, please give a solution as soon as...
0
10468
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10205
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10021
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9063
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7559
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5458
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4131
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.