L
Loti20
Hello. I am rather new to all of this, so please be patient...
I am a technical writer and try to create a macro that inserts icons,
formats the icon, and indents the text. I think i've figured out how to
insert the icon and format it. My problem is indenting the paragraph that
goes with the icon. So for instance (Note being used instead of icon):
Note: This is a sample paragraph. I'm just typing to fill in space and to
show you
what I mean.
I know how to do this in just plain Word, no macro. With the icon being
formatted for infront of text, I then just click the indent button on my
toolbar. The problem is, if I do that while recording the macro, it moves the
icon too.
Here's what I've got so far....
Sub Note()
'
Selection.InlineShapes.AddPicture FileName:= _
"N:\DOCUMENTATION\DocProjects\Standards and Practices
Committee\Conventions\Note.png" _
, LinkToFile:=False, SaveWithDocument:=True
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.InlineShapes(1).Fill.Visible = msoFalse
Selection.InlineShapes(1).Fill.Solid
Selection.InlineShapes(1).Fill.Transparency = 0#
Selection.InlineShapes(1).Line.Weight = 0.75
Selection.InlineShapes(1).Line.Transparency = 0#
Selection.InlineShapes(1).Line.Visible = msoFalse
Selection.InlineShapes(1).LockAspectRatio = msoTrue
Selection.InlineShapes(1).Height = 24#
Selection.InlineShapes(1).Width = 24#
Selection.InlineShapes(1).PictureFormat.Brightness = 0.5
Selection.InlineShapes(1).PictureFormat.Contrast = 0.5
Selection.InlineShapes(1).PictureFormat.ColorType = msoPictureAutomatic
Selection.InlineShapes(1).PictureFormat.CropLeft = 0#
Selection.InlineShapes(1).PictureFormat.CropRight = 0#
Selection.InlineShapes(1).PictureFormat.CropTop = 0#
Selection.InlineShapes(1).PictureFormat.CropBottom = 0#
ActiveDocument.InlineShapes(1).ConvertToShape
Set Icon = ActiveDocument.Shapes(1)
With Icon
.ZOrder msoSendInFrontText
End With
End Sub
I am a technical writer and try to create a macro that inserts icons,
formats the icon, and indents the text. I think i've figured out how to
insert the icon and format it. My problem is indenting the paragraph that
goes with the icon. So for instance (Note being used instead of icon):
Note: This is a sample paragraph. I'm just typing to fill in space and to
show you
what I mean.
I know how to do this in just plain Word, no macro. With the icon being
formatted for infront of text, I then just click the indent button on my
toolbar. The problem is, if I do that while recording the macro, it moves the
icon too.
Here's what I've got so far....
Sub Note()
'
Selection.InlineShapes.AddPicture FileName:= _
"N:\DOCUMENTATION\DocProjects\Standards and Practices
Committee\Conventions\Note.png" _
, LinkToFile:=False, SaveWithDocument:=True
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.InlineShapes(1).Fill.Visible = msoFalse
Selection.InlineShapes(1).Fill.Solid
Selection.InlineShapes(1).Fill.Transparency = 0#
Selection.InlineShapes(1).Line.Weight = 0.75
Selection.InlineShapes(1).Line.Transparency = 0#
Selection.InlineShapes(1).Line.Visible = msoFalse
Selection.InlineShapes(1).LockAspectRatio = msoTrue
Selection.InlineShapes(1).Height = 24#
Selection.InlineShapes(1).Width = 24#
Selection.InlineShapes(1).PictureFormat.Brightness = 0.5
Selection.InlineShapes(1).PictureFormat.Contrast = 0.5
Selection.InlineShapes(1).PictureFormat.ColorType = msoPictureAutomatic
Selection.InlineShapes(1).PictureFormat.CropLeft = 0#
Selection.InlineShapes(1).PictureFormat.CropRight = 0#
Selection.InlineShapes(1).PictureFormat.CropTop = 0#
Selection.InlineShapes(1).PictureFormat.CropBottom = 0#
ActiveDocument.InlineShapes(1).ConvertToShape
Set Icon = ActiveDocument.Shapes(1)
With Icon
.ZOrder msoSendInFrontText
End With
End Sub