R
Randolph Wang
I am controlling Word 2003 via a VB.NET 2003 program.
The program creates an invoice using word and uses a table when it
prints the invoice detail.
At the conclusion of the outputting the table, I perform an autofit.
I autofit the table to the content and then autofit the table to
windows so the table will look nice.
oSelection.Tables(1).AutoFitBehavior(Word.WdAutoFitBehavior.wdAutoFitContent)
oSelection.Tables(1).AutoFitBehavior(Word.WdAutoFitBehavior.wdAutoFitWindow)
At the beginning, the above commands do not work at all. The only way
I can get them to work is add a wait in between the commands.
Something similar to a doevents.
Even with that, the autofit will work only 75% of the time. It is not
failing because of something strange about the table because I can
generate the same invoice the next time and the table will autofit
properly.
Any clue as to how I can make it work every time?
Thanks in advance
Randy
The program creates an invoice using word and uses a table when it
prints the invoice detail.
At the conclusion of the outputting the table, I perform an autofit.
I autofit the table to the content and then autofit the table to
windows so the table will look nice.
oSelection.Tables(1).AutoFitBehavior(Word.WdAutoFitBehavior.wdAutoFitContent)
oSelection.Tables(1).AutoFitBehavior(Word.WdAutoFitBehavior.wdAutoFitWindow)
At the beginning, the above commands do not work at all. The only way
I can get them to work is add a wait in between the commands.
Something similar to a doevents.
Even with that, the autofit will work only 75% of the time. It is not
failing because of something strange about the table because I can
generate the same invoice the next time and the table will autofit
properly.
Any clue as to how I can make it work every time?
Thanks in advance
Randy