G'day "satya" <satya.mahesh@gmail.com>,
You would need to write some VBA. See word.mvps.org/FAQs for more
information on writing VBA. Said VBA would look through the paragraphs
collection:
if a para is a heading:
if the flag is not on:
turn the flag on
else (flag is on)
delete back to the previous heading
end if
end if
if the para is not a heading AND contains text, turn the flag off
Steve Hudson - Word Heretic
steve from wordheretic.com (Email replies require payment)
Without prejudice
satya reckoned:
>Hi All,
>
[quoted text clipped - 17 lines]
>Regards,
>satya
satya - 07 Mar 2006 21:39 GMT
Hi Steve,
Thank you for replying. The requirement has changed a little. I want a
macro which "eliminates blank lines in export
(between headings and when a heading is empty)". For e.g:
Heading1
Heading2
Heading3
This is text under Heading 3
Output should be:
Heading1
Heading2
Heading3
This is text under Heading 3
Since heading heading 3 has content I want one blank space before the
content otherwise there should not be a blank. I did write one macro
which deletes blank lines. What it is doing is displaying the results
as follows:
Heading1
Heading2
Heading3
This is text under Heading 3
In order to solve this I inserted one dummy field(Ctl + F9) before the
paragraph under heading 3,hid that field and ran my macro so it worked.
However, I want it to dynamically recognise that there is text and
insert a blank line.Any ideas as to how it could be done? Appreciate if
anyone could provide me with a solution to this problem.
Thanks & Regards,
satya
Suzanne S. Barnhill - 07 Mar 2006 22:30 GMT
Instead of creating a "blank line" by inserting an empty paragraph, format
your body text with Space Before or your heading style with Space After.

Signature
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
> Hi Steve,
>
[quoted text clipped - 36 lines]
> Thanks & Regards,
> satya