A macro to increase line spacing

I'm trying to make a macro on my Word 2007 "Quick Access Toolbar" that will 
add 6 points after each line that I've selected. When I record a macro to do 
this, it adds the 6 points fine, but then sets the indent at "0", which was 
what the paragraph had when I recorded the macro. What I'd like it to do is 
ignore the indent of whatever paragraph I'm using the macro on, leave it as 
it is, and just add 6 points. Any suggestions how to do that? 

Here is how the Macro reads in VB--perhaps if I alter some of the parameters 
that would do it. Thanks for any help. 

Sub SpaceAdd()
'
' SpaceAdd Macro
'
'
    With Selection.ParagraphFormat
        .LeftIndent = InchesToPoints(0)
        .RightIndent = InchesToPoints(0)
        .SpaceBefore = 0
        .SpaceBeforeAuto = False
        .SpaceAfter = 6
        .SpaceAfterAuto = False
        .LineSpacingRule = wdLineSpaceSingle
        .Alignment = wdAlignParagraphLeft
        .WidowControl = True
        .KeepWithNext = False
        .KeepTogether = False
        .PageBreakBefore = False
        .NoLineNumber = False
        .Hyphenation = True
        .FirstLineIndent = InchesToPoints(0)
        .OutlineLevel = wdOutlineLevelBodyText
        .CharacterUnitLeftIndent = 0
        .CharacterUnitRightIndent = 0
        .CharacterUnitFirstLineIndent = 0
        .LineUnitBefore = 0
        .LineUnitAfter = 0
        .MirrorIndents = False
        .TextboxTightWrap = wdTightNone
        .ReadingOrder = wdReadingOrderLtr
    End With
End Sub
0
Utf
1/17/2010 9:04:01 PM
word.vba.general 1023 articles. 1 followers. Follow

1 Replies
2792 Views

Similar Articles

[PageSpeed] 5

Delete the line of code that is doing the thing that you do not want done. 
That is

        .LeftIndent = InchesToPoints(0)


-- 
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.

"DeeDeeCee" <DeeDeeCee@discussions.microsoft.com> wrote in message 
news:F3480578-8040-4E97-B600-6B3DB52F2DBB@microsoft.com...
> I'm trying to make a macro on my Word 2007 "Quick Access Toolbar" that 
> will
> add 6 points after each line that I've selected. When I record a macro to 
> do
> this, it adds the 6 points fine, but then sets the indent at "0", which 
> was
> what the paragraph had when I recorded the macro. What I'd like it to do 
> is
> ignore the indent of whatever paragraph I'm using the macro on, leave it 
> as
> it is, and just add 6 points. Any suggestions how to do that?
>
> Here is how the Macro reads in VB--perhaps if I alter some of the 
> parameters
> that would do it. Thanks for any help.
>
> Sub SpaceAdd()
> '
> ' SpaceAdd Macro
> '
> '
>    With Selection.ParagraphFormat
>        .LeftIndent = InchesToPoints(0)
>        .RightIndent = InchesToPoints(0)
>        .SpaceBefore = 0
>        .SpaceBeforeAuto = False
>        .SpaceAfter = 6
>        .SpaceAfterAuto = False
>        .LineSpacingRule = wdLineSpaceSingle
>        .Alignment = wdAlignParagraphLeft
>        .WidowControl = True
>        .KeepWithNext = False
>        .KeepTogether = False
>        .PageBreakBefore = False
>        .NoLineNumber = False
>        .Hyphenation = True
>        .FirstLineIndent = InchesToPoints(0)
>        .OutlineLevel = wdOutlineLevelBodyText
>        .CharacterUnitLeftIndent = 0
>        .CharacterUnitRightIndent = 0
>        .CharacterUnitFirstLineIndent = 0
>        .LineUnitBefore = 0
>        .LineUnitAfter = 0
>        .MirrorIndents = False
>        .TextboxTightWrap = wdTightNone
>        .ReadingOrder = wdReadingOrderLtr
>    End With
> End Sub 

0
Doug
1/17/2010 9:38:57 PM
Reply:

Similar Artilces:

macro/worksheet/chart interaction
I am running a macro which simulates an engineering application. The macro essentially time steps, sending the data at each time step to a worksheet, and a chart is set up to display the data in graphical form. Problem - although the worksheet is updated at each time step, the chart only updates when the macro has finished executing - and I want to see the data being graphed as the simulation proceeds - is there anyway of getting the macro to pause while the chart is updated - some kind of handshake between EXCEL and the macro? (At the moment the only way I can do this is to put a STOP in t...

Macro recorder #2
How can I use relative references in my macro when I record a macro with the "record"-tool? >-----Original Message----- >How can I use relative references in my macro when I >record a macro with the "record"-tool? >. > Use the arrowkeys in a formula this will give you something like this ActiveCell.FormulaR1C1 = "=RC[-3]*RC[-1]" Regards Peter Click the "Relative Reference" toolbutton (the second toolbutton) on the Stop Recording toolbar, which should appear when you start recording. If it doesn't appear that would be beca...

Auto macro in Excel help
Hi all, I have a workbook with multiple sheets. I want the sheet 1 always to display first and is there a method to display the current user name which updates it self automatically when different users use the book when its on a share - I'm thinking of setting up a log. I've done the following as a test but its not really what I want - ideally there would be a text box that auto changes without it having to be clicked. Sub logontest() Worksheets("Frontscreen").Activate Dim x Set x = CreateObject("WSCRIPT.Network") Dim u u = x.UserName 'up...

adding more code to an existing macro
Many thanks to those who helped me last week with my question of assigning macro to checkboxes. I now have a new related question. I am trying to add some new commands to the undo portion of my checkbox macro and just tried to copy in the new code next to what I already had, but I keep getting error messages. This is the code for the new actions: Range("G15").Select Selection.ClearContents Range("I15").Select Selection.ClearContents Range("C15").Select ActiveCell.FormulaR1C1 = "=RC[4]*RC[6]" Range("D15").Select When ...

How do I make a new paragraph and tab it without all the lines?
When I go to make a new paragraph, I hit "enter" to go a line down. I hit "tab" to indent the start of the next paragraph, and then I proceed to type. To my astonishment, the entire next paragraph is written one tab over, instead of just making one tab to begin the paragraph. I understand I could just use spacebar, or just type it in word 1st, but I just want to type it in onenote. How do I get it to act like word? ...

Excel File Rename Macro Help!
Hello All! Daily csv files are dumped into a shared folder and i have written a macro that goes into that folder and automatically pull in data to put it in microsoft access tables. What i want to do next is after importing the data into access, rename those files to include dates and times. This import runs every morning so whenever a new csv is dumped in there, my macro will run the newest ones and avoid the past ones. Any ideas guys? I guess im looking for a rename macro sql script. Please see below script. Any help would be greatly appreciated!! Dim fso As Object, fol As Object, fils...

A little macro help?
I would like to use a macro to copy and repeat lines 'X' times on a new page. To find out how many times each row is to be copied, the number is provided in the last column ('C' in this case) of a spreadsheet. Sample data for start point: Lastname First Name Qty Smith John 3 Hank Aaron 5 Result required on new sheet in same spreadsheet: Lastname First Name Smith John Smith John Smith John Hank Aaron Hank Aaron Hank Aaron Hank Aaron Hank Aaron Can someone provide some macro code that will create the number of required rows on a new sheet called 'list' within th...

Problem when running the sample data macro
In order to install PA I´m trying to install sample data from the Project Accounting Sample Data.mac for the Great Plains sample company. So I can learn how to use it myself. But when the macro is running we have the following message and the macro process stops: "An unexpected modal dialog appeared. (Line# 5480 )" Could someone help me about this? It is quite important for me to implement PA module. So I will appreciate if you can help me to run this macro properly. Regards There are some important things to do prior to running the macro. 1. Make sure the tax tables...

Is there a way to run the Cube build from the command line? STSAD
Want to know if there is a way to run the cube build, and the AD sync job from the command line? This is very strange problem... I can run the above jobs manuely, but the scheduled job fails... Both using the same account. Wanted to see if I can run from the CLI... Project server 2007 x64, installed on a MOSS 2007 Farm x64 The issue is most likely the SSP account. There are no STSADM command lines for firing off the cube build but there's probably a way to do it from Analysis Services, which I can't help you with. For a complete list and overview of STSADM comm...

excel macros truncating tabs for hidden columns.
Hi, I have written VBA macros in Excel 2003 to generate a tab delimited text file.I have some hidden columns as well and the file is being generated fine with extra tabs for the hidden columns.Howvever for line numbers >= 1985 the hidden columns are being truncated as in these extra tabs are not being generated. i process the file in my VB 6.0 application wherein i check the number of tab delimited columns that are being generated. for line number>= 1985, the application gives me an error :"Invalid file format". What is it that i am missing here!!! ...

Why show Enable/Disable macro prompt after I deleted all macros?
Hi, I used to have some macros in my excel which I deleted. Now I still get the Enable/disable macro prompt and the Personal workbook (where the macros were) keep opening- it's irritating, how do i stop both?. I want to keep my security settings as it is. Thanks You probably still have a module or modules in the VB Editor. Go to the VB editor and right click on any modules and select delete, when asked if you want to export data, select no. HTH Regards, Howard "m123" <m123@discussions.microsoft.com> wrote in message news:14116171-55E6-4A25-BF8F-FF...

Lining up data from concatenation
A1 = 1234 A2 = 5 B1 = project 1 B2 = project 2 If I do this in C1 =concatentate(A1," ",B1) I get 1234 project1 for C1. That's fine but doing the same thing for row 2 gets me 5 project 2 I need a way to do this (without a macro because I'm totally helpless when it comes to macros) so that Column C lines up everything in Column A AND everything in column B so the data is in 1 cell and the "p" in project lines up vertically no matter how many characters are in the number in Column A. The data HAS TO be in a single cell - no merging cells and changing border...

Recording new excel macro, relative reference button doesn't show
When recording a new macro in excel I want to select the relative reference button in the stop recording box, but the stop recording box does not popup; it's no where to be found. Everything I've read on-line says it just appears, but it doesn't on my system. It works fine on my co-workers machine, and he has the same system as mine. We are both running Windows XP, with excel version 2003. hi, not sure why it isn't popping up on your machine. it does on mine. but you can access it anyway. Tools>customize>toolbar tab>check stop recording scroll down.....

Open an excel spreadsheet and run a macro from Access VB
I have an Access 2007 database that creates an Excel spreadsheet via the DoCmd.OutputTo method. The method creates and opens the Excel spreadsheet. Is there any way to have Access run an Excel macro from another spreadsheet in the one that was just created? (I need Access to create DataSpreadsheet, open DataSpreadsheet, then run a macro from MacroSpreadsheet in DataSpreadsheet) I'm not sure if you run Excel code in Access, per se, but why don't you just put your excel code inside of an access module??? Make sure you set a reference to Excel, and then run this cod...

Run Macro only if certain form is open
I have programed a maco to open one of various forms depending on criteria on an open form. Is there a way to run a "follow up Macro" based on which form opens? In other words can I run a macro based on wheather a certain form is active? -- Thanks, Chuck Take a look at the RunMacro Method of the DoCmd object. You can have it as part of the OnLoad of the form in question. Chuck wrote: >I have programed a maco to open one of various forms depending on criteria on >an open form. Is there a way to run a "follow up Macro" based on which form >opens? In other w...

how do i graph gender & age in in a line graph?
i need to compare age and gender on a line graph but i can not get gender to be different from just a line how do i change that? Your question is not too clear. It would be nice to see part of your data. Are you saying that Excel plots two lines rather than one? If so, delete the text at the top of the first column you are using for data. -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "lost&needhelp" <lost&needhelp@discussions.microsoft.com> wrote in message news:88472E93-9D32-48B6-8B2C-FAF17EED4ACB@microsoft.com......

toolbar line see what you have typed
How do I put the line in the toolbar that will show what I've typed so I can make corrections without having to retype the entire row? Click on View on the worksheet menu bar. then make sure Formula bar is checked Then you can position the I-bar cursor where you want. Tinkerbell wrote: > > How do I put the line in the toolbar that will show what I've typed so I can > make corrections without having to retype the entire row? -- Dave Peterson So the poster may have been missing the formula bar. <grin> Use of F2 will help with entry so that you don't have t...

Spacing #2
Hi Trim removes spacing in the beginning and end of word. How can i delete a spacing betwee two words (name) ex "De Wit" > i want "dewit" THX Luc You can use: =substitute(a1," ","") to remove all the spaces (leading/trailing/embedded) or =lower(substitute(a1," ","")) if you really wanted lower case. Luc Vandenhoeck wrote: > > Hi > Trim removes spacing in the beginning and end of word. > How can i delete a spacing betwee two words (name) ex "De Wit" > i want > "dewit" > THX Luc -- ...

type a word on the line without desturbing the line
I am using Outlook Publisher and I need to know how do I type on a line without desturbing the line. Not sure I understand. Do you want to overwrite a line of text? If you want to add a word without the line moving, use the character spacing option in the format menu. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Bermuda Mama" <Bermuda Mama@discussions.microsoft.com> wrote in message news:615FB725-748E-4403-B41F-AB9CAFC19971@microsoft.com... >I am using Outlook Publisher and I need to know how do I type on a li...

command line build...turn on or off the auto-increment option
C:\Program Files\Microsoft Visual Studio\VB98\VB6.exe /MAKE /OUT "C:\src\MyApplicationSourceFiles\MyApplication.vbp.log" "C:\src\MyApplicationSourceFiles\MyApplication.vbp" /outdir "C:\BuildResults\MyApplication\" The above is what I have now. Is there any way from the command line to turn on/off the "auto increment" option? My motivation is that........when I do a "Gold Build", I want to increment. But when I do a non-gold-everyday routine build, I don't want it to auto increment. This is actually the one leftover...

How to put coefficients of trend line into spreadsheet?
I fit a 4th-order polynomial curve to data in a chart and chose the option to display the equation. But when I put that equation into cells in the spreadsheet, the evaluated formula does not even come close to the original Y values, even though I am usin the same X values. I wonder if it is due to round-off error in the displayed equation. How can I get the exact coefficients of a trend line -- specifically a polynomial of any order -- into a spreadsheet? PS: Is it mathematically true that there is always an N-order polynomial that exactly fits N+1 data points? That has been my experience...

Macro not working properly when run automatically
Hi there, I thought I posted a thread about this, but can't seem to find it. Anyway, the problem is I have the macro below. It works when I run it manually from the macro menu, but bugs when I use VB to edit it into running automaticaly (tried Wookbook_Open and Wookbook_BeforeSave). Using Ex2003 by the way. It's supposed to sort all sheets according to High, Medium, Low by: 1-Convert High, Medium, Low to 1,2,3 accross workbook. 2-Sort each sheet according to 1,2,3 3-Convert 1,2,3 back into High, Medium, Low. Now when I run it automatically, if there is High, Medium, L...

macro to pick last row in a range
i need help on this do we have a macro which finds the last row in a range and picks up th last row and insert it below first row of the range thank u al -- Message posted from http://www.ExcelForum.com try this Sub moveit() x = Cells(Rows.Count, "a").End(xlUp).Row Rows(x).Cut Rows("2:2").Insert shift:=xlDown End Sub -- Don Guillett SalesAid Software donaldb@281.com "vikram >" <<vikram.166y5g@excelforum-nospam.com> wrote in message news:vikram.166y5g@excelforum-nospam.com... > i need help on this > > do we have a macro which finds the...

custom views / macros #2
I created a custom view from a master document that included every third row hidden (I manually hid every third row for 1000 rows -whew!). I added a macro that showed a particular heading row for that view, and assigned a shortcut. I saved the worksheet as a template. The worksheet was then re-saved with a new name, cells filled in. The custom view worked a few times, then stopped hiding every third row in the view. 1. I don't know why the view stopped hiding the rows and 2. can you help me write a macro that will automatically hide every third row?? This will Hide every third row s...

90% line across line chart
I have a changing set of data that is 3 columns and 104 row. These are represented on a Line Chart. I have a formula to calculate the 90th percentile for each of these. How do I automatically put a horizontal line on the chart for each of the three measurement at the corresponding 90th percentile. Thanks, Brad On Fri, 20 Apr 2007, in microsoft.public.excel.charting, Brad K. <BradK@discussions.microsoft.com> said: >I have a changing set of data that is 3 columns and 104 row. These are >represented on a Line Chart. I have a formula to calculate the 90th >percentile for e...