PDA

View Full Version : Changing rotation and Text wrapping for all shapes in document



Cubajz
02-28-2017, 03:40 AM
Hi guys,
for reason I donīt know (or understand) WordMacro Record application cannot change anything from Layout window (I find next picture, then go to Format menu, then to Layout and do the changes there - but in the end nothing is recorded). The same is with Text wrapping (also in Layout window).

I need macro that would set rotation of picture to =0. And regarding Text wrapping - I want it "Top and Bottom"; and Distance from text top = 0.5 and bottom = 0.5. I need this for all my pictures in document. Thanks for help guys!:hi:

gmayor
02-28-2017, 07:34 AM
There are lots of things the macro recorder won't do. This is one of them.

What is the current wrap option? The default is in-line. The results of changing an in-line graphic to a wrapped floating graphic can be unpredictable. It might take more effort to put your document right after such a process than to do it manually.

Personally for this type of layout I would use in line graphics, with the graphics each on their own line and the spacing set by paragraph spacing.

Cubajz
02-28-2017, 08:33 AM
Yes,you are right - This aproach to my problem was wrong. I have come up with this one, which could be easier (I think):
I need a macro that would change Picture border (Format->Picture border) for every picture in document - and change itīs color to white and width of the line to be 6b. Is this possible? Thanks for replying:yes

gmaxey
02-28-2017, 04:08 PM
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oIls As InlineShape
For Each oIls In ActiveDocument.Range.InlineShapes
If oIls.Type = wdInlineShapePicture Then
With oIls
.Line.Weight = 6
.Line.ForeColor = wdColorWhite
End With
End If
Next
lbl_Exit:
Exit Sub
End Sub

Cubajz
03-01-2017, 03:37 AM
Thank you, that works great.:clap:
The only thing I miss now is how to resolve the rotation problem...See some of my pictures are set to 90° or 270° and some are set to 0° (according to info in Format->Layout->Rotation). I need all pictures to have rotation 0°. Is there a way to make this with macro? Thanks, you guys rock!:bow:

gmaxey
03-01-2017, 05:54 AM
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oIls As InlineShape
Dim oShp As Shape
For Each oIls In ActiveDocument.Range.InlineShapes
If oIls.Type = wdInlineShapePicture Then
With oIls
.Line.Weight = 6
.Line.ForeColor = wdColorWhite
Set oShp = .ConvertToShape
oShp.Rotation = 0
Set oIls = oShp.ConvertToInlineShape
End With
End If
Next
lbl_Exit:
Exit Sub
End Sub

Cubajz
03-01-2017, 08:49 AM
Thanks:hi: