Microsoft Office Tutorials and References
In Depth Information
Changing the Borders
' * * * * *¶
Function FormatFrame(ByRef frm As Word.Frame)¶
'Set the borders¶
frm.Borders.Enable = False¶
If frm.Borders.Enable = True Then¶
With frm.Borders¶
.OutsideColorIndex = wdBlack¶
.OutsideLineStyle = wdLineStyleSingle¶
.OutsideLineWidth = wdLineWidth050pt¶
End With¶
End If¶
'Determine how the frame sizes¶
'The frame can size a picture proportionally¶
'if an exact height OR width is set,¶
'and let the other dimension size automatically¶
'Use if the frame should be a certain height¶
frm.HeightRule = LimitPictureHeight¶
If LimitPictureHeight <> wdFrameAuto Then¶
frm.HeightRule = LimitPictureHeight¶
frm.Height = InchesToPoints(3)¶
End If¶
'Use if the frame should be a certain width¶
frm.WidthRule = LimitPictureWidth¶
If LimitPictureWidth <> wdFrameAuto Then¶
frm.WidthRule = wdFrameAtLeast¶
frm.Width = InchesToPoints(1.5)¶
End If¶
frm.RelativeHorizontalPosition = _¶
wdRelativeHorizontalPositionColumn¶
frm.HorizontalPosition = wdFrameRight¶
'Corresponds to "Move with text"¶
frm.RelativeVerticalPosition = _¶
wdRelativeVerticalPositionParagraph¶
frm.VerticalPosition = 0¶
frm.LockAnchor = False¶
frm.TextWrap = True¶
End Function¶
' * * * * *¶
Sub AddaCaptionInaFrame(rng As Word.Range)¶
'Move to the end of the frame¶
rng.Collapse wdCollapseEnd¶
'Add a new line¶
rng.InsertAfter vbCr¶
'Select just that line¶
If rng.Frames.Count = 1 Then¶
'with frame¶
rng.Collapse wdCollapseEnd¶
Else¶
'without frame¶
rng.Collapse wdCollapseStart¶
End If¶
Wrd
Search JabSto ::




Custom Search