K
Keith G Hicks
When I run the following code in word, the last line gives me a result of
0.2777778 inches. This is not correct actually. The text box is resizing and
is really 1.927083 inches tall. If I run this: ?Selection.ShapeRange.Height
/ 72 in the immediate window, AFTER the code below is run it shows the
correct height. Any ideas on how to get the code to really see the right
height? -Keith
Dim shpCanvas As Shape
Set shpCanvas =
ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 20, 20, 138,
20)
shpCanvas.Name = "tbFNTNotice"
ActiveDocument.Shapes("tbFNTNotice").Select
'Selection.WholeStory
Selection.Font.Name = "Helvetica"
Selection.Font.Size = 7.5
Selection.TypeText Text:= _
"Peter Parker (Tobey Maguire) is so poor he is living in a tenement
room with a " _
& " mattress and a bare light bulb. He works as a pizza deliveryman
while taking " _
& " science classes at Columbia University. His sweet Aunt Mary
(Rosemary Harris) " _
& " is so broke she is losing her tiny house. My advice to Parker?
Take a mailroom " _
& " job at your friend's Harry Osborn (James Franco) monolithic
company. Or, better " _
& " yet, do an interview as Spider-Man with a tabloid for $100,000
in cash! Let " _
& " Aunt Mary live her last days in financial peace. Don't you owe
her something (for " _
& " being responsible for your uncle's death that left Aunt Mary
lonely and destitute)? "
With Selection.ShapeRange.TextFrame
.AutoSize = True
.WordWrap = True
.MarginTop = 0
.MarginRight = 0
.MarginBottom = 0
.MarginLeft = 0
End With
Debug.Print Selection.ShapeRange.Height / 72 '72 points = 1 inch
0.2777778 inches. This is not correct actually. The text box is resizing and
is really 1.927083 inches tall. If I run this: ?Selection.ShapeRange.Height
/ 72 in the immediate window, AFTER the code below is run it shows the
correct height. Any ideas on how to get the code to really see the right
height? -Keith
Dim shpCanvas As Shape
Set shpCanvas =
ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 20, 20, 138,
20)
shpCanvas.Name = "tbFNTNotice"
ActiveDocument.Shapes("tbFNTNotice").Select
'Selection.WholeStory
Selection.Font.Name = "Helvetica"
Selection.Font.Size = 7.5
Selection.TypeText Text:= _
"Peter Parker (Tobey Maguire) is so poor he is living in a tenement
room with a " _
& " mattress and a bare light bulb. He works as a pizza deliveryman
while taking " _
& " science classes at Columbia University. His sweet Aunt Mary
(Rosemary Harris) " _
& " is so broke she is losing her tiny house. My advice to Parker?
Take a mailroom " _
& " job at your friend's Harry Osborn (James Franco) monolithic
company. Or, better " _
& " yet, do an interview as Spider-Man with a tabloid for $100,000
in cash! Let " _
& " Aunt Mary live her last days in financial peace. Don't you owe
her something (for " _
& " being responsible for your uncle's death that left Aunt Mary
lonely and destitute)? "
With Selection.ShapeRange.TextFrame
.AutoSize = True
.WordWrap = True
.MarginTop = 0
.MarginRight = 0
.MarginBottom = 0
.MarginLeft = 0
End With
Debug.Print Selection.ShapeRange.Height / 72 '72 points = 1 inch