![]() |
#1
|
|||
|
|||
![]()
Hi there,
I wonder if there's any possibility to create a macro that would format a larger number of text boxes even though they are grouped. In fact, I deal with such grouped items on a daily basis, and because these are usually in large quantities, I'd like to use a macro. What is essential for me is that the text boxes must always have these font properties (character spacing): Scale = 100% Spacing = Normal Position = Normal No Kerning for fonts
Sub Ungroup() Dim xNmbr As Integer With ActiveDocument For xNmbr = .Shapes.Count To 1 Step -1 .Shapes(xNmbr).Select Set thisshape = .Shapes(xNmbr) With thisshape.WrapFormat .Type = wdWrapSquare If thisshape.Type = msoGroup Then thisshape.Ungroup End With Next End With End Sub
Sub SetTextBoxStyle() Dim objTextBox As Shape Dim objDoc As Document Application.ScreenUpdating = False Set objDoc = ActiveDocument For Each objTextBox In objDoc.Shapes ' Set line style. With objTextBox.Line .Visible = msoTrue .ForeColor.RGB = RGB(255, 255, 255) End With ' Set fill color. objTextBox.Fill.ForeColor.RGB = RGB(255, 255, 255) ' Set text color. objTextBox.TextFrame.TextRange.Font.TextColor.RGB = RGB(8, 8, 8) ' Set text size. objTextBox.TextFrame.TextRange.Font.Size = 10 ' Set font face. objTextBox.TextFrame.TextRange.Font.Name = "Arial Narrow" ' Set character spacing. objTextBox.TextFrame.TextRange.Font.Spacing = 0 ' Set character spacing. objTextBox.TextFrame.TextRange.Font.Scaling = 100 ' Set character spacing. objTextBox.TextFrame.TextRange.Font.Position = 0 Next objTextBox Application.ScreenUpdating = True End Sub Unfortunately, this process did not entirely work; it did ungroup all the text boxes. BUT it wouldn't successfully run the second macro, most likely because an object number got too large and thus the macro failed. Please, would you have any idea what might be the problem. Anyway, I really don't insist on running the first macro for ungrouping the textboxes, as they tend to disassemble in a quite chaotic way. I only need to set the spacing of characters in all text boxes (as quickly/easily as possible). Thanks a lot! Irene |
Tags |
character spacing, font formatting macro, textboxes |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
ianmck | Drawing and Graphics | 5 | 06-28-2018 09:04 PM |
Macro to insert different sets of text at bookmark depending on sequence of selected check boxes | chipper09 | Word VBA | 0 | 06-21-2018 01:49 PM |
![]() |
RHODIUM | Word | 6 | 10-01-2016 04:43 PM |
![]() |
TzarChasm | Word | 7 | 04-14-2016 06:28 PM |
Macro (or something) to run Spell Check within rich text content boxes in lock document | NMBELL | Word | 8 | 12-21-2015 04:09 PM |