Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-03-2015, 06:05 AM
drew345 drew345 is offline Text Wrapping AND maintaining place with text?? Windows 8 Text Wrapping AND maintaining place with text?? Office 2010 32bit
Novice
Text Wrapping AND maintaining place with text??
 
Join Date: Sep 2015
Posts: 13
drew345 is on a distinguished road
Default Text Wrapping AND maintaining place with text??

I am using text wrapping with my figures and the wrapping looks quite nice. The problem is if I make edits in an earlier part of the document that makes the text change pages, then the figure doesn't follow the text and ends up on the wrong page.


For example. I have a figure at the start of section 4.5.3 on page 77 (for example). It is related to the text of that section. I do text wrapping and all looks good. Now... I make some edits to section 3.1.1 and that causes section 4.5.3 to move to page 76. But the figure stays on page 77 and is no longer with the correct text. When I choose "text wrapping" it eliminates the "in line with text" (can't have both) and so the figure no longer stays with the relevant text.
Is there any way to use text wrapping AND have the figure stay at the start of section 4.5.3 (or with whatever relevant text).

Thanks!
Drew
Reply With Quote
  #2  
Old 12-03-2015, 12:52 PM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Text Wrapping AND maintaining place with text?? Windows 7 64bit Text Wrapping AND maintaining place with text?? Office 2013
Moderator
 
Join Date: Aug 2011
Posts: 3,871
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

When you add a caption to a wrapped object, Word adds the caption in a text box, which makes them a bit difficult to manage.

As an alternative, you can put the object "In line with text" and then just add the caption in the paragraph below. You can wrap a frame around the two paragraphs (for that, use the Insert Horizontal Frame command which you can add to your Quick Access Toolbar).
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional

Last edited by Stefan Blom; 12-03-2015 at 03:53 PM.
Reply With Quote
  #3  
Old 12-03-2015, 02:40 PM
drew345 drew345 is offline Text Wrapping AND maintaining place with text?? Windows 8 Text Wrapping AND maintaining place with text?? Office 2010 32bit
Novice
Text Wrapping AND maintaining place with text??
 
Join Date: Sep 2015
Posts: 13
drew345 is on a distinguished road
Default

Thank you for the comment. I am not having any problems with captions. The captions stay with the figures just fine.
My problem is that the figure (and caption) do not stay in the proper section of the document when the section moves to another page due to editing in an earlier part of the document. The figure (and caption) stay on the same page even though the related section may move to a page before or after.
Is there a way to have text wrapping and still have the figure stay in the proper section even as section moves from one page to another due to earlier edits?

Thanks
Reply With Quote
  #4  
Old 12-03-2015, 04:06 PM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Text Wrapping AND maintaining place with text?? Windows 7 64bit Text Wrapping AND maintaining place with text?? Office 2013
Moderator
 
Join Date: Aug 2011
Posts: 3,871
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

Which Text Wrapping option has been selected for the object (and its caption)? Which specific positioning options do you see in the Layout dialog box? (To display the dialog box, right-click the object border, click Wrap Text, and then click More Layout Options.)

To be more precise, you need an option that positions the objects relative to text paragraphs, not relative to the page edge or margin.

It's all rather convoluted, but not impossible of course.

"In line with text" does have certain advantages. It's worth considering.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #5  
Old 12-03-2015, 04:27 PM
drew345 drew345 is offline Text Wrapping AND maintaining place with text?? Windows 8 Text Wrapping AND maintaining place with text?? Office 2010 32bit
Novice
Text Wrapping AND maintaining place with text??
 
Join Date: Sep 2015
Posts: 13
drew345 is on a distinguished road
Default

I am using "Square Wrapping Style". Specific positions I see are :
Horizontal:
Alignment
Book Layout
Absolute Position
Relative Position
Vertical
Alignment
Absolute Position
Relative Position

I never saw that menu before , it has a lot more options than the ribbon menu. I am pretty sure my solution is in there somewhere... But all of the options I see are for aligning it with page and margins. I don't see anything about keeping a figure in a certain section or near a certain paragraph. Probably in there somewhere though.

"In line with text " works great for keeping the figures in in the right place (relative to connected section or paragraph. But all that white space to the side of the figure looks so unprofessional. Looks much better to wrap text through that white space.

I really wish I could use text wrapping but keep the figure "locked" to be near a certain paragraph or section heading.

Edit: I found the "Keep Object with text" button on the bottom of that layout menu, but I can't see that it actually does anything. I try selecting it but the object still stays fixed on the page even as nearby text moves.

Thanks,
Reply With Quote
  #6  
Old 12-03-2015, 04:45 PM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Text Wrapping AND maintaining place with text?? Windows 7 64bit Text Wrapping AND maintaining place with text?? Office 2013
Moderator
 
Join Date: Aug 2011
Posts: 3,871
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

Under "Vertical," select "Absolute position" and choose "Paragraph" in the "below" box. The "Paragraph" option refers to the paragraph containing the object anchor. In my screen shot, the picture would be 2 cm below the anchor paragraph.

To see anchors as well as other nonprinting marks, click the ¶ button on the Home tab.
Attached Images
File Type: png LayoutDialog.PNG (20.7 KB, 20 views)
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #7  
Old 12-03-2015, 05:09 PM
drew345 drew345 is offline Text Wrapping AND maintaining place with text?? Windows 8 Text Wrapping AND maintaining place with text?? Office 2010 32bit
Novice
Text Wrapping AND maintaining place with text??
 
Join Date: Sep 2015
Posts: 13
drew345 is on a distinguished road
Default

Wow, That's great! Do I have to insert or create the anchor myself? Or is the anchor created automatically when I select the absolute position paragraph option?

That was it! Thanks so much. I see the anchor when I select vertical relative to paragraph and it stays with that just great.
Thanks so much. I'll try to pass on the good karma.

Last edited by drew345; 12-03-2015 at 08:12 PM.
Reply With Quote
  #8  
Old 12-03-2015, 08:51 PM
macropod's Avatar
macropod macropod is online now Text Wrapping AND maintaining place with text?? Windows 7 64bit Text Wrapping AND maintaining place with text?? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Stefan Blom View Post
When you add a caption to a wrapped object, Word adds the caption in a text box, which makes them a bit difficult to manage.

As an alternative, you can put the object "In line with text" and then just add the caption in the paragraph below.
The approach I take is to use a table to keep the image & caption together.

The following macro embeds all Shapes & InlineShapes in a document in tables as InlineShapes with a row for Captions. Whatever positioning applied to the original Shape object will apply to the table also.

As coded, the ‘MakeImageTable’ macro limits the inserted InlineShape dimesnsions to 7.5*5.0cm. That code can, of course, be edited/omitted, in which case, so can the corresponding code that re-sizes the inserted InlineShape to fit. The macro also defaults to generating its own captions, but you can drag your own captions (Figure 1, Figure 2, etc.) into the table and replace the auto ones.

Note that, due to the extra space taken up by the caption row, all except for the first of the document's pictures are liable to shift position.
Code:
Sub AddImageCaptionTables()
Dim iShp As InlineShape, Rng As Range, Tbl As Table
Dim i As Long, PicWdth As Single, PicHght As Single, VPos As Single
Dim HPos As Single, VRel As Long, HRel As Long, BShp As Boolean
With ActiveDocument
  For i = 1 To .InlineShapes.Count
    If .InlineShapes(i).Range.Information(wdWithInTable) = False Then
      PicWdth = .InlineShapes(i).Width
      Set Rng = .InlineShapes(i).Range
      With Rng
        If .Characters.Last.Next.Text = vbCr Then .Characters.Last.Next.Text = vbNullString
        PicWdth = .InlineShapes(1).Width
        PicHght = .InlineShapes(1).Height
        .InlineShapes(1).Range.Cut
      End With
      BShp = False: VRel = 0: HRel = 0: VPos = 0: HPos = 0
      Call MakeImageTable(Rng, PicWdth, PicHght, BShp, VRel, HRel, VPos, HPos)
    End If
  Next
  While .Shapes.Count > 0
    BShp = True
    With .Shapes(1)
      PicWdth = .Width
      PicHght = .Height
      VRel = .RelativeVerticalPosition
      HRel = .RelativeHorizontalPosition
      VPos = .Top
      HPos = .Left
      Set iShp = .ConvertToInlineShape
    End With
    With iShp
      Set Rng = .Range
      .Range.Cut
    End With
    Call MakeImageTable(Rng, PicWdth, PicHght, BShp, VRel, HRel, VPos, HPos)
  Wend
End With
End Sub
 
Sub MakeImageTable(Rng As Range, PicWdth As Single, PicHght As Single, BShp As Boolean, _
  VRel As Long, HRel As Long, VPos As Single, HPos As Single)
Dim Tbl As Table, sngScl As Single, iShp As InlineShape
'Constrain maximum image size
If PicWdth > CentimetersToPoints(7.5) Then
  sngScl = PicWdth / CentimetersToPoints(7.5)
  PicWdth = PicWdth / sngScl
  PicHght = PicHght / sngScl
End If
If PicHght > CentimetersToPoints(5) Then
  sngScl = PicHght / CentimetersToPoints(5)
  PicWdth = PicWdth / sngScl
  PicHght = PicHght / sngScl
End If
'Create & format the table
Set Tbl = Rng.Tables.Add(Range:=Rng, Numrows:=2, NumColumns:=1)
With Tbl
  .Borders.Enable = True
  .Columns.Width = PicWdth
  .TopPadding = 0
  .BottomPadding = 0
  .LeftPadding = 0
  .RightPadding = 0
  .Spacing = 0
  .Rows(1).HeightRule = wdRowHeightExactly
  .Rows(1).Height = PicHght
  With .Rows
    .LeftIndent = 0
    If BShp = True Then
      .WrapAroundText = True
      .HorizontalPosition = HPos
      .RelativeHorizontalPosition = HRel
      .VerticalPosition = VPos
      .RelativeVerticalPosition = VRel
      .AllowOverlap = False
    End If
  End With
  With .Cell(1, 1).Range
    With .ParagraphFormat
      .SpaceBefore = 0
      .SpaceAfter = 0
      .LeftIndent = 0
      .RightIndent = 0
      .FirstLineIndent = 0
      .KeepWithNext = True
    End With
    .Paste
    ' Resize the inserted InlineShape
    Set iShp = .InlineShapes(1)
    With iShp
      .Width = PicWdth
      .Height = PicHght
    End With
  End With
  With .Cell(2, 1).Range
    .Style = "Caption"
    .End = .End - 1
    .InsertAfter vbCr
    .InsertCaption Label:="Figure", TitleAutoText:=" ", Title:="", _
      Position:=wdCaptionPositionBelow, ExcludeLabel:=0
    .Characters.First.Text = vbNullString
    .Paragraphs.First.Range.Characters.Last.Text = vbNullString
    .Borders(wdBorderLeft).LineStyle = wdLineStyleNone
    .Borders(wdBorderRight).LineStyle = wdLineStyleNone
    .Borders(wdBorderTop).LineStyle = wdLineStyleNone
  End With
End With
End Sub
To work with just the selected image (or multiple images in a selected range), change:
With ActiveDocument
to:
With Selection
and change:
While .Shapes.Count > 0
With .Shapes(1)
to:
While .ShapeRange.Count > 0
With .ShapeRange(1)

To have the caption row appear above the image, instead of below, change the Rows(1) references to Rows(2), change the Cell(1, 1) references to Cell(2, 1) and change the change the Cell(2, 1) references to Cell(1, 1).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 12-04-2015, 02:01 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Text Wrapping AND maintaining place with text?? Windows 7 64bit Text Wrapping AND maintaining place with text?? Office 2013
Moderator
 
Join Date: Aug 2011
Posts: 3,871
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

The anchor is always present for objects whose Text Wrapping is something other than "In line with text," but you have to select the object to see the anchor. You must also display anchors in Word (and one way is to show nonprinting marks).
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text Wrapping AND maintaining place with text?? editing a number/text at one place and changes taking place wherever it appears anurag.butoliya Word 1 06-14-2014 06:27 PM
Wrapping text On Table, Possible? CaIeb Word 2 08-15-2013 06:01 PM
Maintaining word format when linking text from excel MikeFee Office 0 06-11-2013 05:03 PM
Text Wrapping JFS0650 Word 1 09-09-2012 11:31 AM
Text and Image Wrapping Gonzo231 Word 1 01-03-2012 09:18 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:50 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft