how to calculate string width

J

Jay Taplin

I'm not sure what else you would be looking for beyond what the solution on
the Google groups would give you, but below is a link to a page that has a
download that will get you the text size using the API (you'll need to
register with the site to download the file, but registration is free):

http://www.xtremevbtalk.net/showthread.php?t=125084

Jay Taplin MCP
 
R

rVo

If the string is already in a document you could use this trick to figure
out if it's multiline or not...

You position the cursor at the beginning of the string and get the
selection.information(wdFirstCharacterLineNumber)
Next you position the cursor at the end of the string and ask the same
information. If the second value is different from the first one it's
multiline.

But ofcourse using the api is more elegant. Please consider that all pc's
that use your template will need the api installed as well though.
 
Y

YiShusen

Thank you both. rVo's trick sounds good to me. however, because I
insert the string in a table cell, the
selection.information(wdFirstCharacterLineNumber) behavours different
than I expect. So I need more sugestion, please.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top