#  Other Applications & Softwares  > Word Formatting & General >  > [SOLVED] Reverse negative Indents

## jomili

Often I copy stuff from various websites to add to a document I'm preparing.  Many times when I paste my copied stuff into Word, I have multiple lines that originally were indented, but for some reason the pasted version has a negative indent.  For instance, a line of text that appears on the web to have about a .25" indent, when pasted into my Word, has an indent of -.25".  This doesn't always happen, but often enough to be a pain. 

My fix is to go to each section that this happens to, select it, and format the paragraph to a positive .25".

Since to my way of thinking a negative indent shouldn't ever exist, I'd like to come up with a macro that will change all of the Negative indents to a positive indent of the same degree (ie: -.25 beceomes +.25, -.5 becomes .5, etc.)  I'm not familiar enough with Word macros to do this on my own, so I'm asking for help.  

Thanks in advance.

----------


## macropod

If you paste the content into Word as unformatted text, the negative indents would be unlikely to appear (unless you already had them in your document). In any event, you could just select the pasted range and choose any suitable Style and apply that.

Simply overriding paragraph Styles to change the indents is not to be recommended. That said, you could use a macro like:



```
Please Login or Register  to view this content.
```

----------


## jomili

While I agree that pasting as unformatted text would solve the issue, sometimes I want to retain the formatting, and that's where I have my difficulties.  I tried the macro, and it didn't do anything.  I then tried to trim it down to just handle a selection, like this:


```
Please Login or Register  to view this content.
```


For this I got a reaction "Compile Error: Method or data member not found", indicating the second "LeftIndent"

I've attached an example of the situation I'm working with.  Notice the bullets have negative indents.

----------


## macropod

Since your document has both left indents and first-line indents, add the line:
Para.FirstLineIndent = Abs(Para.FirstLineIndent)
after:
Para.LeftIndent = Abs(Para.LeftIndent)

----------


## jomili

I thought that might be the issue, but had no idea how to address it.  Your solution does the trick.  Thanks so much for your help on this.  

Bonus question (if you're interested): in the example file, the black bullets show a negative indent.  The  white (or hollow) bullets also show a negative indent, the same value as the black, but the hollow ones should have a greater indent (ie: if black is indented .25, white should be .5).  So, the black and white should be in a parent/child relationship.  Any idea how to tackle a fix on that?

----------


## macropod

Although the code I posted fixes the basic issue, the underlying issue with your document is that is makes no use of Word's Styles. Had it done so, no code would be required - a simple change to the Style definitions is all that would be needed. That said, you could change:
Para.FirstLineIndent = Abs(Para.FirstLineIndent)
to:
Para.FirstLineIndent = Abs(Para.FirstLineIndent) * Para.Range.ListFormat.ListLevelNumber

----------


## macropod

Alhtough the code I posted fixes the basic issue, the underlying issue with your document is that is makes no use of Word's Styles. Had it done so, no code would be required - a simple change to the Style definitions is all that would be needed. That said, you could change:
Para.FirstLineIndent = Abs(Para.FirstLineIndent)
to:
Para.FirstLineIndent = Abs(Para.FirstLineIndent) * Para.Range.ListFormat.ListLevelNumber

----------


## jomili

I've read comments before about how powerful Styles can be in Word, but haven't yet taken the time to read up on Styles to learn how they can help.  Perhaps now is the time.  Do you know a good available resource?

----------


## macropod

You could start with:
https://support.office.com/en-us/art...5-9CBB6EDE1BA4
http://shaunakelly.com/word/styles/stylesms.html
http://www.addbalance.com/usersguide/styles.htm

----------


## jomili

Thanks for all the help.  I've bookmarked the three sites and will start reading up today!

----------

