Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2007

Tip: Looking for answers? Try searching our database.

Autosize for TextBoxes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mojeaux65@gmail.com - 19 Apr 2007 15:07 GMT
Hi,
I'm somewhat of a newbie to word vba.  Is there a way to adjust the
text size so that you can see all of its contents... even if its 2
lines or 20 lines?  I've tried adjusting the TextBox2 properties to:
Autosize:  True
MaxLength: 850
MultiLine: True
Height:  15
Width: 9.75 - 475
WordWrap: True

With these settings, It only allows me to type 1-2 characters before
going to the next line.  Without Autosize, I can type about 10-12
lines before you are unable to see the rest of the text.

I need to have the text box automatically change size to fit its
content.  Is there a way to do this with vba code?  Any help would be
appreciated!  Thx, Mojeaux
Greg Maxey - 19 Apr 2007 16:46 GMT
Sub ScratchMacro()
Dim oShp As Shape
For Each oShp In ActiveDocument.Shapes
 If oShp.Type = msoTextBox Then
   oShp.TextFrame.AutoSize = True
 End If
Next oShp
ActiveDocument.PrintPreview
ActiveDocument.ClosePrintPreview
End Sub

On Apr 19, 10:07 am, Mojeau...@gmail.com wrote:
> Hi,
> I'm somewhat of a newbie to word vba.  Is there a way to adjust the
[quoted text clipped - 14 lines]
> content.  Is there a way to do this with vba code?  Any help would be
> appreciated!  Thx, Mojeaux
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.