PDA

View Full Version : text rotation in publisher



hermiston
08-17-2006, 10:50 AM
My programming is limited in VBA. I am writing macros to automate labels. I've created a text box and want to insert and format the text within the box so it is rotated 90 degrees, has Franklin Gothic Book font, is size 7 and is centered within the text box. The code I currently have is:

Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="0.28 in", Top:="0.5 in", Width:="0.15625 in", Height:="0.5 in")
shpSmallTextBox.TextFrame.TextRange.Text = "xxxxxxxx"
.FontName = "Franklin Gothic Book"
.Font.Size = 7

This produces no text, but without the FontName and Font.Size lines it will place the text within the box.

Could I get a sample code of what I am trying to accomplish from someone. Or, clarification of where my misunderstanding of the coding is gone wrong.

Thank you for any assistance.

Zack Barresse
08-17-2006, 02:42 PM
Hi there,

I haven't tried your code, but why aren't the latter two properties set with the object? ..

shpSmallTextBox.TextFrame.TextRange.Text = "xxxxxxxx"
shpSmallTextBox..FontName = "Franklin Gothic Book"
shpSmallTextBox..Font.Size = 7

Is it erroring out? Can you zip/upload a sample file?

Also, are you actually from Hermiston Oregon? If so, I'm in Boardman! Small world. :yes

hermiston
08-17-2006, 03:23 PM
As I said I am new to VBA and it's syntax. It does not error out or even show an error in the debugging/compiling. It just puts the text into the textbox created unformatted without the two lines, or produces nothing with them. I am assuming my syntax for the second two lines is incorrect and causing the results.
Is what you wrote the right syntax for part what I am trying to accomplish? If so, the next issue is the rotation and centering. I can figure out the math of it if I can just get the syntax down right (with the right properties, etc.).

Yes, I am in Hermiston. The world gets smaller all the time, neighbor.

Thanks for all the help.

Zack Barresse
08-17-2006, 03:33 PM
Can you post all of your code?

hermiston
08-17-2006, 04:09 PM
Sure, it's kind of ugly though. I'm just getting started on the code and am trying to grasp the syntax of such a heavily managed code. So, let me explain what I'm doing. I am trying so set up a way to print inventory control labels using Avery labels 8167. I have the layout guides working when the document is opened and then I am trying to write a macro that will draw the text boxes (which it currently does). If I had more experience with the syntax an array function would be more efficient in drawing the boxes.
The small text boxes will contain the same name in all of them (10 letters), rotated 90 degrees, with the franklin gothic book font, size 7, fill color and centered.
Across each 4 labels will be 4 seperate colors (like red, green, yellow and blue), the columns of 20 will contain the same color down. This is in the small text boxes.

The large text boxes will then contain a barcode font with 12 characters (these will be sequential numbering, with the first char being a letter and the following 11 the sequential numbers). Example "J00000000001 or K00000000012". These will have the same number across the 4 in a row, and be sequential as you go down each column. Basically 4 labels for each of the inventory items. The char at the beginning of each number will be the same for each building.
I will need to also build a form for the user input of what the starting sequence number will be and what char will be on these numbers and how many pages to print.



Private Sub Document_Open()
ActiveDocument.LayoutGuides.Columns = 4
ActiveDocument.LayoutGuides.Rows = 20
ActiveDocument.LayoutGuides.MarginBottom = Application.InchesToPoints(Value:=0.5)
ActiveDocument.LayoutGuides.MarginTop = Application.InchesToPoints(Value:=0.5)
ActiveDocument.LayoutGuides.MarginLeft = Application.InchesToPoints(Value:=0.28)
ActiveDocument.LayoutGuides.MarginRight = Application.InchesToPoints(Value:=0.28)
ActiveDocument.LayoutGuides.ColumnGutterWidth = Application.InchesToPoints(Value:=0.31)
ActiveDocument.LayoutGuides.RowGutterWidth = Application.InchesToPoints(Value:=0)
End Sub

Sub txtBoxDraw()
Dim shpSmallTextBox As Shape
Dim shpLargeTextBox As Shape

Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="0.28 in", Top:="0.5 in", Width:="0.15625 in", Height:="0.5 in")
shpSmallTextBox.TextFrame.TextRange.Text = "xxxxxxxxxx"

Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="0.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="0.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="0.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".28 in", Top:="1 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="1 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="1 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="1 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".28 in", Top:="1.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="1.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="1.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="1.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".28 in", Top:="2 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="2 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="2 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="2 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".28 in", Top:="2.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="2.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="2.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="2.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="0.28 in", Top:="3 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="3 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="3 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="3 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".28 in", Top:="3.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="3.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="3.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="3.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".28 in", Top:="4 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="4 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="4 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="4 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".28 in", Top:="4.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="4.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="4.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="4.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".28 in", Top:="5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="0.28 in", Top:="5.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="5.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="5.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="5.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".28 in", Top:="6 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="6 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="6 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="6 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".28 in", Top:="6.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="6.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="6.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="6.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".28 in", Top:="7 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="7 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="7 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="7 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".28 in", Top:="7.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="7.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="7.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="7.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="0.28 in", Top:="8 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="8 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="8 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="8 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".28 in", Top:="8.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="8.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="8.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="8.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".28 in", Top:="9 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="9 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="9 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="9 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".28 in", Top:="9.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="9.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="9.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="9.5 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".28 in", Top:="10 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.34 in", Top:="10 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.4 in", Top:="10 in", Width:="0.15625 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.46 in", Top:="10 in", Width:="0.15625 in", Height:="0.5 in")

Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:=".5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:=".5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:=".5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:=".5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="1 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="1 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="1 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="1 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="1.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="1.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="1.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="1.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="2 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="2 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="2 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="2 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="2.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="2.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="2.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="2.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="3 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="3 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="3 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="3 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="3.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="3.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="3.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="3.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="4 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="4 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="4 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="4 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="4.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="4.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="4.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="4.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="5.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="5.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="5.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="5.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="6 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="6 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="6 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="6 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="6.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="6.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="6.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="6.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="7 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="7 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="7 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="7 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="7.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="7.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="7.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="7.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="8 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="8 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="8 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="8 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="8.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="8.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="8.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="8.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="9 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="9 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="9 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="9 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="9.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="9.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="9.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="9.5 in", Width:="1.59375 in", Height:="0.5 in")
Set shpLargeTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:=".43625 in", Top:="10 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="2.49625 in", Top:="10 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="4.55625 in", Top:="10 in", Width:="1.59375 in", Height:="0.5 in")
Set shpSmallTextBox = ActiveDocument.Pages(1).Shapes.AddTextbox(Orientation:=pbTextOrientationHor izontal, Left:="6.616625 in", Top:="10 in", Width:="1.59375 in", Height:="0.5 in")


End Sub


Once again, I appreciate any help you can offer.

Thanks

Zack Barresse
08-18-2006, 08:59 AM
I could create a document to test with, but if you have one you could zip/upload it would be faster than me creating from scratch.

hermiston
08-18-2006, 09:58 AM
Here is a zipped file of what I have been playing with so far.

3714

Thanks,

Zack Barresse
08-18-2006, 12:01 PM
Working on this, have a condensed version, working on a progress bar. Will post later.

Zack Barresse
08-21-2006, 07:35 AM
Okay, not sure how to get the progress bar working in Publisher (I can get it in Excel), but this code works for me ...

Sub txtBoxDraw()

Dim shpSmall1 As Shape, shpSmall2 As Shape, shpSmall3 As Shape, shpSmall4 As Shape
Dim shpLarge1 As Shape, shpLarge2 As Shape, shpLarge3 As Shape, shpLarge4 As Shape
Dim i As Long

Application.ScreenUpdating = False
With ActiveDocument.Pages(1).Shapes
For i = 1 To 20
'----------------------------------------------------------------
Set shpSmall1 = .AddTextbox(pbTextOrientationHorizontal, _
".28 in", CStr((i * 0.5) & " in"), "0.15625 in", "0.5 in")
shpSmall1.TextFrame.TextRange.Text = "xxxxxxxxxx"
shpSmall1.TextFrame.TextRange.Font.Name = "Franklin Gothic Book"
shpSmall1.TextFrame.TextRange.Font.Size = 7
Set shpSmall2 = .AddTextbox(pbTextOrientationHorizontal, _
"2.34 in", CStr((i * 0.5) & " in"), "0.15625 in", "0.5 in")
shpSmall2.TextFrame.TextRange.Text = "xxxxxxxxxx"
shpSmall2.TextFrame.TextRange.Font.Name = "Franklin Gothic Book"
shpSmall2.TextFrame.TextRange.Font.Size = 7
Set shpSmall3 = .AddTextbox(pbTextOrientationHorizontal, _
"4.4 in", CStr((i * 0.5) & " in"), "0.15625 in", "0.5 in")
shpSmall3.TextFrame.TextRange.Text = "xxxxxxxxxx"
shpSmall3.TextFrame.TextRange.Font.Name = "Franklin Gothic Book"
shpSmall3.TextFrame.TextRange.Font.Size = 7
Set shpSmall4 = .AddTextbox(pbTextOrientationHorizontal, _
"6.46 in", CStr((i * 0.5) & " in"), "0.15625 in", "0.5 in")
shpSmall4.TextFrame.TextRange.Text = "xxxxxxxxxx"
shpSmall4.TextFrame.TextRange.Font.Name = "Franklin Gothic Book"
shpSmall4.TextFrame.TextRange.Font.Size = 7
'----------------------------------------------------------------
Set shpLarge1 = .AddTextbox(pbTextOrientationHorizontal, _
".43625 in", CStr((i * 0.5) & " in"), "1.59375 in", "0.5 in")
shpLarge1.TextFrame.TextRange.Text = "xxxxxxxxxx"
shpLarge1.TextFrame.TextRange.Font.Name = "Franklin Gothic Book"
shpLarge1.TextFrame.TextRange.Font.Size = 7
Set shpLarge2 = .AddTextbox(pbTextOrientationHorizontal, _
"2.49625 in", CStr((i * 0.5) & " in"), "1.59375 in", "0.5 in")
shpLarge2.TextFrame.TextRange.Text = "xxxxxxxxxx"
shpLarge2.TextFrame.TextRange.Font.Name = "Franklin Gothic Book"
shpLarge2.TextFrame.TextRange.Font.Size = 7
Set shpLarge3 = .AddTextbox(pbTextOrientationHorizontal, _
"4.55625 in", CStr((i * 0.5) & " in"), "1.59375 in", "0.5 in")
shpLarge3.TextFrame.TextRange.Text = "xxxxxxxxxx"
shpLarge3.TextFrame.TextRange.Font.Name = "Franklin Gothic Book"
shpLarge3.TextFrame.TextRange.Font.Size = 7
Set shpLarge4 = .AddTextbox(pbTextOrientationHorizontal, _
"6.616625 in", CStr((i * 0.5) & " in"), "1.59375 in", "0.5 in")
shpLarge4.TextFrame.TextRange.Text = "xxxxxxxxxx"
shpLarge4.TextFrame.TextRange.Font.Name = "Franklin Gothic Book"
shpLarge4.TextFrame.TextRange.Font.Size = 7
'----------------------------------------------------------------
Next i
End With
Application.ScreenUpdating = True

End Sub

I'll continue to try the progress bar (because the code takes a little bit to run) and post if I have anything. This works for me in Publisher 2003.

HTH

hermiston
08-21-2006, 08:52 AM
Wow, this is a great help.
Thank you very much.
I'll post if I run into any problems. And keep an eye out in case you get the progress bar working.