word vba within excel Remove Space After Paragraph

  • Dear Gurus,


    i have posted the question in the following link, however did not get a solution, grateful if you take a look into my vba code.


    am using excel vba with word object library to create a memo from the ranges in excel cells.


    now i am typing some texts and when i moved from my first typetext to the second with type paragraph then there is a considerablly big space between first line and the second line. i can remove that via word document manually "Line and Paragraph Spacing" on the dropdown "Remove Space After Paragraph" however i am trying to perform the same manual thing through the VBA code. i searched through Google and i found in some forums that either .Paragraphs.SpaceBefore = 0 or .Paragraphs.SpaceAfter = 0 which work, however i tried and still did not work. i do not know where to put the .Paragraphs.SpaceAfter = 0 either before the second text or after it. any help would be appreciated.


    P.S when i use record macro to check how macro is recording the code. unfortunately recording macro does not record any code for "Line and Paragraph Spacing" on the dropdown "Remove Space After Paragraph".



    With WordApp .Documents.Add With .Selection.TypeText Text:="Project Advances and Project Expenses".TypeParagraph.TypeText Text:="Project Budget & Project Cash"


    link posted in another forum. attached below
    http://www.mrexcel.com/forum/e…-spacebefore-%3D-0-a.html

  • Re: word vba within excel Remove Space After Paragraph


    Not sure how this will fit into your code, as I am quite new at this, but why not try record macro to give you the outline?


    Code
    Selection.MoveDown Unit:=wdLine, Count:=4, Extend:=wdExtend

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!