Group:  Microsoft Word ยป microsoft.public.word.customization.menustoolbars
Thread: Eliminating blank lines in export

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Eliminating blank lines in export
"satya" <satya.mahesh[ at ]gmail.com> 05.03.2006 22:22:03
Hi All,

Whenever I try to export contents to a word document through an
application, I see blank lines between headings when a heading is
empty. If the heading is empty I do not want it to be displayed. Is
there anyway this could be achieved in a word document. For e.g:

Heading 1
Heading 2
Heading 3
This section deals with .......

Here since Heading 1 and Heading 2 do not have any contents in it I do
not want them to be displayed in the word document. I want the output
as below:

Heading 3
This section deals with .......


Regards,
satya

Re: Eliminating blank lines in export
Word Heretic <myfullname[ at ]iinet.net.au> 07.03.2006 15:05:31
G'day "satya" <satya.mahesh[ at ]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:

[Quoted Text]
>Hi All,
>
> Whenever I try to export contents to a word document through an
>application, I see blank lines between headings when a heading is
>empty. If the heading is empty I do not want it to be displayed. Is
>there anyway this could be achieved in a word document. For e.g:
>
>Heading 1
>Heading 2
>Heading 3
>This section deals with .......
>
>Here since Heading 1 and Heading 2 do not have any contents in it I do
>not want them to be displayed in the word document. I want the output
>as below:
>
>Heading 3
>This section deals with .......
>
>
>Regards,
>satya

Re: Eliminating blank lines in export
"satya" <satya.mahesh[ at ]gmail.com> 07.03.2006 21:39:18
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

Re: Eliminating blank lines in export
"Suzanne S. Barnhill" <sbarnhill[ at ]mvps.org> 07.03.2006 22:30:22
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.

--
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.

"satya" <satya.mahesh[ at ]gmail.com> wrote in message
news:1141767558.845314.290530[ at ]z34g2000cwc.googlegroups.com...
[Quoted Text]
> 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
>

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net