Annoying extra line, when insertein a .doc into ActiveDocument

E

Ebbe

Hey!

In a macro, that types in text controlled by a ASCII text file,
there is a possibility to change headers/footers by inserting a
new .doc file after making a break-new-page.

I have discovered that Word automatically add a blank line
in the top of the inserted document. This have the effect that
I am going on typing in text starting at line 2 instead of line 1.

I have made a work-around by issuing a backspace to delete
this extra line before beginning typing in.

Can anyone tell me why this extra line is inserted?

Can anyone tell me who to avoid this extra line?

My code with the work around:
-----------------------------------------------------
Private Sub ShowTheProblem
Selsction.TypeText "Last line on a page"
Selection.InsertBreak Type:=wdSectionBreakNextPage
Selection.InsertFile FileName:=NewBaseDoc(NewBaseDocNo), _
Range:="", ConfirmConversions:=False, Link:=False, _
Attachment:=False
Selection.TypeBackspace '**** Work around ****

Selsction.TypeText "First line on next page"
End Sub
 
W

Word Heretic

G'day "Ebbe" <[email protected]>,

Turn on Tools > Options > View > Formatting Marks > All

You'll probably see a section break with a spare anchor para on it.

Steve Hudson
Word Heretic Sydney Australia
Tricky stuff with Word or words

Email: WordHeretic at tpg.com.au


Ebbe was spinning this yarn:
 
E

Ebbe

Dear Steve
You are right! I have a anchor! But it is not a spare anchor.
The document I am inserting is buind with a header with some some text and a
grafic element (a water mark), thar is anchored up to/in the header.
I have no anchor in the text body.

I can post an examble if neeted (30KB)

Ebbe

Word Heretic said:
G'day "Ebbe" <[email protected]>,

Turn on Tools > Options > View > Formatting Marks > All

You'll probably see a section break with a spare anchor para on it.

Steve Hudson
Word Heretic Sydney Australia
Tricky stuff with Word or words

Email: WordHeretic at tpg.com.au


Ebbe was spinning this yarn:
 
W

Word Heretic

G'day "Ebbe",

You'll have to email it to me, don't post it to the list - we don't
like attachments. I'll have a quick look for you.


Steve Hudson
Word Heretic Sydney Australia
Tricky stuff with Word or words

Email: WordHeretic at tpg.com.au


Ebbe was spinning this yarn:
Dear Steve
You are right! I have a anchor! But it is not a spare anchor.
The document I am inserting is buind with a header with some some text and a
grafic element (a water mark), thar is anchored up to/in the header.
I have no anchor in the text body.

I can post an examble if neeted (30KB)

Ebbe
 
E

Ebbe

I've mailed some stuff to you.

Thanks

Ebbe
Word Heretic said:
G'day "Ebbe",

You'll have to email it to me, don't post it to the list - we don't
like attachments. I'll have a quick look for you.


Steve Hudson
Word Heretic Sydney Australia
Tricky stuff with Word or words

Email: WordHeretic at tpg.com.au


Ebbe was spinning this yarn:
 
W

Word Heretic

G'day Ebbe,

When you insert the break it moves the para mark to the next page -
then you go to insert a file, which starts its own new para.

You can't insert a file "inline" so to speak. This is why your para at
the break end isnt moving on past the inserted file, and why a simple
backspace fixes it.


Steve Hudson
Word Heretic Sydney Australia
Tricky stuff with Word or words

Email: WordHeretic at tpg.com.au


Ebbe was spinning this yarn:
 
E

Ebbe

Dear Steve

Thank you fore your help.
Now I understand the extra line.
I also understand, that my way to fix the problem IS the way to fix it.

Ebbe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top