LC7Web
asked on
borders and shading styles
Is there a way to specify borders and shading styles for images within a word document? As i have over 100 images i would like to apply a style for.
I am using word 2003.
I am using word 2003.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
If i use the Find and Replace dialog to search for Special>Graphic
How do i specify replace ^g with the new macro i created?
How do i specify replace ^g with the new macro i created?
Here LC7 - just try this - this combines the two macros - just run it (providing you don't already have a style called "Image"):
Sub Image()
ActiveDocument.Styles.Add Name:="Image", Type:=wdStyleTypeParagraph
With ActiveDocument.Styles("Ima ge")
.AutomaticallyUpdate = False
.BaseStyle = "Normal"
.NextParagraphStyle = "Image"
End With
With ActiveDocument.Styles("Ima ge").Font
With ActiveDocument.Styles("Ima ge").Parag raphFormat
End With
ActiveDocument.Styles("Ima ge").Parag raphFormat .TabStops. ClearAll
With ActiveDocument.Styles("Ima ge").Parag raphFormat
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = wdColorAutomatic
End With
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth225pt
.Color = wdColorBlue
End With
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth225pt
.Color = wdColorBlue
End With
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth225pt
.Color = wdColorBlue
End With
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth225pt
.Color = wdColorBlue
End With
With .Borders
.DistanceFromTop = 1
.DistanceFromLeft = 4
.DistanceFromBottom = 1
.DistanceFromRight = 4
.Shadow = True
End With
End With
Selection.Style = ActiveDocument.Styles("Ima ge")
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormat ting
Selection.Find.Style = ActiveDocument.Styles("Nor mal")
Selection.Find.ParagraphFo rmat.Borde rs.Shadow = False
Selection.Find.Replacement .ClearForm atting
Selection.Find.Replacement .Style = ActiveDocument.Styles("Ima ge")
Selection.Find.Replacement .Paragraph Format.Bor ders.Shado w = False
With Selection.Find
.Text = "^g"
.Replacement.Text = ""
.Forward = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub Image()
ActiveDocument.Styles.Add Name:="Image", Type:=wdStyleTypeParagraph
With ActiveDocument.Styles("Ima
.AutomaticallyUpdate = False
.BaseStyle = "Normal"
.NextParagraphStyle = "Image"
End With
With ActiveDocument.Styles("Ima
With ActiveDocument.Styles("Ima
End With
ActiveDocument.Styles("Ima
With ActiveDocument.Styles("Ima
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = wdColorAutomatic
End With
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth225pt
.Color = wdColorBlue
End With
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth225pt
.Color = wdColorBlue
End With
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth225pt
.Color = wdColorBlue
End With
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth225pt
.Color = wdColorBlue
End With
With .Borders
.DistanceFromTop = 1
.DistanceFromLeft = 4
.DistanceFromBottom = 1
.DistanceFromRight = 4
.Shadow = True
End With
End With
Selection.Style = ActiveDocument.Styles("Ima
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormat
Selection.Find.Style = ActiveDocument.Styles("Nor
Selection.Find.ParagraphFo
Selection.Find.Replacement
Selection.Find.Replacement
Selection.Find.Replacement
With Selection.Find
.Text = "^g"
.Replacement.Text = ""
.Forward = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
ASKER
Great, thanks!
Thanks much LC!
ASKER