Formatting pictures and text


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
 
Ad

Advertisements

D

Doug Robbins - Word MVP

I would suggest that you create an autotext entry that includes the icon in
an indented paragraph and just insert that autotext.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
L

Loti20

Thanks for the suggestion Doug, but I'm not looking to put in the same text
every time. Scenario...

I'm typing along when I get to some information that is "important". I
finished typing the couple of sentences that are "important" and then run the
macro. The macro inserts the icon, formats the icon, and shifts the text.
 
Ad

Advertisements

D

Doug Robbins - Word MVP

I was not suggesting that the text be in the autotext which would end with a
paragraph mark and hence the required formatting. You would insert the
autotext, then insert the text into the paragraph containing the autotext.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top