Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Menus and Toolbars / March 2006

Tip: Looking for answers? Try searching our database.

Eliminating blank lines in export

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
satya - 05 Mar 2006 22:22 GMT
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
Word Heretic - 07 Mar 2006 14:52 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.