Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub formatereBilder()
- Application.ScreenUpdating = True
- Dim StoryRange As Range, bilde As InlineShape, rangeBuf As Range
- For Each StoryRange In ActiveDocument.StoryRanges
- For Each bilde In StoryRange.InlineShapes
- Set rangeBuf = bilde.Range.Paragraphs.First.Range
- If rangeBuf.Style <> "Caption" Then
- If rangeBuf.Paragraphs.Last.Next.Style <> "Caption" Then
- bilde.LockAspectRatio = True
- bilde.Width = CentimetersToPoints(12)
- bilde.Line.Weight = 1
- bilde.Line.Style = msoLineSingle
- bilde.Line.ForeColor.RGB = 0
- bilde.Select
- 'hvis du foretrekker midtstilt, uncomment neste linje
- 'Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
- bilde.Range.InsertCaption Label:="Figur", TitleAutoText:="", Title:="", _
- Position:=wdCaptionPositionBelow, ExcludeLabel:=0
- End If
- End If
- Next
- Next
- Set rangeBuf = Nothing
- Application.ScreenUpdating = False
- End Sub
Add Comment
Please, Sign In to add comment