Re: Autosize bug in Excel 2007 shape textframes

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Anthony,
I have no pressing need for Office2007. I'm waiting for an SP or 2 before
<upgrading>.
I'll let you folks figure out the difficult bits before I jump aboard <g>.

NickHK

"Anthony Berglas" <aberglaslist@xxxxxxxxxxx> wrote in message
news:1332p7uak2lru73@xxxxxxxxxxxxxxxxxxxxx
Hmm, clever idea. And I just checked that it still works in XL07. But
what a hack! And performance is passable -- about 5 ms per AutoFit.

I am also comming across bugs in .characters() functions. Nasty,
unrepeatable corrupting ones. I suspect that they have been lurking
since XL95, (and I have ugly work arounds) but are just corrumpting
memory that happens to be more important now.

Anthony

NickHK wrote:

Anthony,
One way, in a cell out of the way somewhere, insert the desired text in
the
correct font, size, formatting etc. Then AutoSize the column. Read the
column width.
You may have to use some scaling factor to convert to the
units/differences
between the worksheet cell and a Text Frame, but at least it should be
constant.
Otherwise, use a fixed width font and no formatting and just multiply by
the
number of characters, if this is practical for you.

NickHK

"Anthony Berglas" <aberglaslist@xxxxxxxxxxx> wrote in message
news:1330a8mlkkiq43@xxxxxxxxxxxxxxxxxxxxx

Good idea, but I just tried it and no, that does not work.

The behavior for comment frames seems slightly different to text boxes,
still investigating.

If anyone knows how to write a WidthOfFontedString(characters) then that
would be great.

(And I have set up a "real" news reader, apologies for the multiple
posts. And all the messages now show up on Google. But not in the
search index. I must have just missed them when I checked this
morning.)

Thanks,

Anthony

NickHK wrote:


Anthony,
I don't use XL2007, but does it jog the Text frame to the correct size

if

you toggle the AutoSize property:

With <YourTextFrame>
.Characters.Text = "Some long line of text spread" & Chr(10) &
"over
several" & Chr(10) & "lines"
.AutoSize=false
.AutoSize=true
End with

NickHK

"Anthony Berglas" <aberglas@xxxxxxxxx> wrote in message
news:1177475279.537744.209630@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


XL 2007 only seems to AutoSize the Height of a text box, not the
Width.
This is different from XL 95..2003 which autosized both.

This is easily seen from the UI, just create an Autoboxed frame and
type into it, only in XL < 2007 does it get wider.

This makes it difficult to programatically create a text box, and put
some text in it and have the box displayed in a natural width. Same
goes for comments etc.

Any ideas for a work around most appreciated. (Guessing the width of
fonted strings is very error prone.)

Regards,

Anthony








.



Relevant Pages

  • Re: DISPID_NAVIGATECOMPLETE2 multiple events
    ... DISPID_NAVIGATECOMPLETE2 is triggered multiple times whe one URL is ... NavigateComplete2 event is fired once for each frame on the page ... Which part of "the first parameter lets you know where the event has ... events that come from a frame, as opposed to top-level browser. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: VBA - Click mouse to change cursor to cross hair that spans th
    ... make sure the frame containing the browser is behind the 2 frames; ... "NickHK" wrote: ... Private Sub ie_MouseMove(ByVal Button As Integer, ...
    (microsoft.public.excel.programming)
  • Re: Page alignment issue
    ... On 12/27/06, Aubrey wrote: ... the first page frame of a block should be a multiple of the group ... the kernel task stack should be 2-page aligned. ...
    (Linux-Kernel)
  • Re: Autosize bug in Excel 2007 shape textframes
    ... Then AutoSize the column. ... use a fixed width font and no formatting and just multiply by the ... (And I have set up a "real" news reader, apologies for the multiple ... but does it jog the Text frame to the correct size ...
    (microsoft.public.excel.programming)
  • Re: Place a table sideways (landscape) on a normal page (portrait)
    ... header rows will work. ... The table that goes in a frame is ... Will this work for a table that will cover multiple pages? ...
    (microsoft.public.word.pagelayout)