Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-22-2024, 05:02 PM
Xavier Xavier is offline How to get rid of lots of unwanted indentations Windows XP How to get rid of lots of unwanted indentations Office 2016
Advanced Beginner
How to get rid of lots of unwanted indentations
 
Join Date: Jul 2023
Posts: 52
Xavier is on a distinguished road
Default How to get rid of lots of unwanted indentations

I am working on a 3,000 page document. Unfortunately the document was converted from a PDF and in word (an RTF file) there are indentations throughout it.



I don't want those. Can anyone describe how I can get rid of them, without having to do it for all of them manually?
Attached Images
File Type: jpg Screenshot showing indentations.jpg (215.6 KB, 26 views)
Reply With Quote
  #2  
Old 02-22-2024, 08:17 PM
Guessed's Avatar
Guessed Guessed is offline How to get rid of lots of unwanted indentations Windows 10 How to get rid of lots of unwanted indentations Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The alignment of the content is easily fixed by applying your preferred style to the content and removing local paragraph formatting by selecting it and pressing Ctrl-Q

Based on what you are showing you would also want to remove some of the extra paragraph marks. For instance, I would use find replace with wildcards on to
find: "^13([a-z])"
replace " \1" Note there is a space in front of the \1

You will have special cases as shown in your sample where THE ACCUSED is the same paragraph as the following line and it shouldn't be.

Also the Ayers Rock should be part of the same paragraph (a find replace process could fix cases like this)
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 02-23-2024, 08:53 AM
Charles Kenyon Charles Kenyon is online now How to get rid of lots of unwanted indentations Windows 11 How to get rid of lots of unwanted indentations Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Converted documents will always have formatting anomalies. Note also the extra paragraph marks at the end of some lines. Find and replace can get rid of those as well.
Reply With Quote
  #4  
Old 02-25-2024, 05:31 PM
Xavier Xavier is offline How to get rid of lots of unwanted indentations Windows XP How to get rid of lots of unwanted indentations Office 2016
Advanced Beginner
How to get rid of lots of unwanted indentations
 
Join Date: Jul 2023
Posts: 52
Xavier is on a distinguished road
Default

Thanks so much for both replies. I am working through it and hopeful I can get the document looking a lot better.
There are however some images that I have been unable to get rid of. I have done a few things to try and fix it. I did a replace ^g with nothing.
I took Guessed's advice with find: "^13([a-z])" and replace with " \1".
I also ran a macro that someone recommended to me:
Sub Macro1()
Dim oShape As Shape
Dim i As Integer
For i = ActiveDocument.Shapes.Count To 1 Step -1
Set oShape = ActiveDocument.Shapes(i)
If oShape.Type = msoPicture Then
oShape.Delete
Else
Debug.Print oShape.Type
End If
Next i
Set oShape = nothing
End Sub
Reply With Quote
  #5  
Old 02-25-2024, 05:44 PM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline How to get rid of lots of unwanted indentations Windows 11 How to get rid of lots of unwanted indentations Office 2021
Moderator
 
Join Date: Aug 2011
Posts: 3,907
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 macro will delete shapes, including text boxes. Did the macro help?

Sometimes, a converted document may put text in text boxes (to imitate the layout of the original source). For example, this may happen with OCR (optical character recognition) software.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional

Last edited by Stefan Blom; 02-26-2024 at 06:23 AM.
Reply With Quote
  #6  
Old 02-25-2024, 06:27 PM
Xavier Xavier is offline How to get rid of lots of unwanted indentations Windows XP How to get rid of lots of unwanted indentations Office 2016
Advanced Beginner
How to get rid of lots of unwanted indentations
 
Join Date: Jul 2023
Posts: 52
Xavier is on a distinguished road
Default

Nah, it seems to still leave some images. Take a look at the screenshot.
Attached Images
File Type: jpg Screenshot of images.jpg (73.6 KB, 24 views)
Reply With Quote
  #7  
Old 02-25-2024, 08:42 PM
Xavier Xavier is offline How to get rid of lots of unwanted indentations Windows XP How to get rid of lots of unwanted indentations Office 2016
Advanced Beginner
How to get rid of lots of unwanted indentations
 
Join Date: Jul 2023
Posts: 52
Xavier is on a distinguished road
Default

I should perhaps add that I am making these edits in an RTF version of Word, so that the finished product isn't too huge. Could that be to blame for the Macro not working properly?
Reply With Quote
  #8  
Old 02-26-2024, 02:44 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline How to get rid of lots of unwanted indentations Windows 11 How to get rid of lots of unwanted indentations Office 2021
Moderator
 
Join Date: Aug 2011
Posts: 3,907
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 Shapes collection, which is used in the macro, will not remove shapes that are positioned "In line with text." For that, you'll need to reference InlineShapes.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #9  
Old 02-26-2024, 02:48 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline How to get rid of lots of unwanted indentations Windows 11 How to get rid of lots of unwanted indentations Office 2021
Moderator
 
Join Date: Aug 2011
Posts: 3,907
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

Are you referring to the tiny shape or object which is repeated in my attached screen shot? I am not sure what it could be. It doesn't display clearly to me.
Attached Images
File Type: png ShapeInDocument.png (130.8 KB, 24 views)
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #10  
Old 02-26-2024, 09:01 AM
Charles Kenyon Charles Kenyon is online now How to get rid of lots of unwanted indentations Windows 11 How to get rid of lots of unwanted indentations Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

My practice, for important documents converted from another format that may have to undergo editing is to paste as plain text in a new document and then format using styles. This does not eliminate all problems but makes for a far cleaner document, less prone to curious anomalies.
Reply With Quote
  #11  
Old 02-26-2024, 09:11 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline How to get rid of lots of unwanted indentations Windows 11 How to get rid of lots of unwanted indentations Office 2021
Moderator
 
Join Date: Aug 2011
Posts: 3,907
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

As Charles said, in many cases, starting fresh in plain text format will be safer, with converted documents. The process may be time-consuming, of course.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #12  
Old 02-26-2024, 04:32 PM
Xavier Xavier is offline How to get rid of lots of unwanted indentations Windows XP How to get rid of lots of unwanted indentations Office 2016
Advanced Beginner
How to get rid of lots of unwanted indentations
 
Join Date: Jul 2023
Posts: 52
Xavier is on a distinguished road
Default

Quote:
Originally Posted by Stefan Blom View Post
Are you referring to the tiny shape or object which is repeated in my attached screen shot? I am not sure what it could be. It doesn't display clearly to me.
Yes, that mark on the document, and even the line that is next to it, which looks like a piece of text is actually an image that I need to remove.
Reply With Quote
  #13  
Old 02-26-2024, 04:33 PM
Xavier Xavier is offline How to get rid of lots of unwanted indentations Windows XP How to get rid of lots of unwanted indentations Office 2016
Advanced Beginner
How to get rid of lots of unwanted indentations
 
Join Date: Jul 2023
Posts: 52
Xavier is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
My practice, for important documents converted from another format that may have to undergo editing is to paste as plain text in a new document and then format using styles. This does not eliminate all problems but makes for a far cleaner document, less prone to curious anomalies.
Yes, it makes the copy cleaner, but losing the formatting for 3000 pages just makes so much more work, especially when removing all the images should be fairly easy I would have thought.
Reply With Quote
  #14  
Old 02-26-2024, 05:33 PM
Xavier Xavier is offline How to get rid of lots of unwanted indentations Windows XP How to get rid of lots of unwanted indentations Office 2016
Advanced Beginner
How to get rid of lots of unwanted indentations
 
Join Date: Jul 2023
Posts: 52
Xavier is on a distinguished road
Default

Quote:
Originally Posted by Stefan Blom View Post
The Shapes collection, which is used in the macro, will not remove shapes that are positioned "In line with text." For that, you'll need to reference InlineShapes.
Thanks for all your insightful replies. I'm not much good with Macros, so if there any way you could paste exactly how I should tweak my macro to reference InlineShapes?
I just don't know where to add that part.
Reply With Quote
  #15  
Old 02-27-2024, 08:14 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline How to get rid of lots of unwanted indentations Windows 11 How to get rid of lots of unwanted indentations Office 2021
Moderator
 
Join Date: Aug 2011
Posts: 3,907
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

At least in theory, you should be able to delete InlineShapes with a very similar macro:

Sub Macro1()
Dim oShape As InlineShape
Dim i As Integer
For i = ActiveDocument.InlineShapes.Count To 1 Step -1
Set oShape = ActiveDocument.InlineShapes(i)
If oShape.Type = msoPicture Then
oShape.Delete
Else
Debug.Print oShape.Type
End If
Next i
Set oShape = Nothing
End Sub

EDIT: The above code only acts on shape objects that are pictures. That is what the msoPicture is referring to. I initially overlooked this when I tried to customize the original macro.


However, I am not sure that I remember correctly which objects are recognized as inline shapes, anymore. :-(

Are you able to share a sample document with the forum? I am not referring to the entire 3000 page document, obviously, but a much shorter version with just the shapes/graphics and some dummy text.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional

Last edited by Stefan Blom; 03-01-2024 at 07:27 AM.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Indentations in Mail and Calendar for Windows 10 Mr M Windows 0 06-20-2018 07:01 AM
How to get rid of lots of unwanted indentations Removing indentations at beginning of paragraphs and replacing with line spaces captainamerica Word 2 10-27-2017 05:32 PM
How to get rid of lots of unwanted indentations Interpreting special characters as bullets and indentations burry01 Word 1 01-18-2016 12:24 AM
Bullet indentations unexpected change richard hans Word 2 01-15-2014 05:14 PM
Word indentations mepossem Word 2 10-07-2013 10:02 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:14 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