Tables allowautofit

R

Ria

Something strange:

I have the following sub:
Sub FormatHTML(oDoc as Document)
dim oTable as Table

For Each oTable In oDoc.Tables
oTable.AllowAutoFit = False
oTable.AllowPageBreaks = True
Next

End Sub

If I run this from VBA then it works the way expected. but if I run this
from my VB application, then the cell widths are not correct.

Does anyone know how to solve this?

Thanx in advance
Ria
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?Umlh?=,

The one possibility that occurs to me is that perhaps the application
window is not set to .Visible = True, so Word isn't correctly calculating
the cell widths (because the page can't lay out)?
I have the following sub:
Sub FormatHTML(oDoc as Document)
dim oTable as Table

For Each oTable In oDoc.Tables
oTable.AllowAutoFit = False
oTable.AllowPageBreaks = True
Next

End Sub

If I run this from VBA then it works the way expected. but if I run this
from my VB application, then the cell widths are not correct.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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