Insertfile function adds a paragraph mark

  • Thread starter Bart Hernalsteen
  • Start date
B

Bart Hernalsteen

Hi,

I have to insert htm-files created by a delphi program.
These are very simple htm-files. (ex : <html><body>Formatting
Text</body></html>)

When I insert this file using the selection.insertfile method between 2
words in the same paragraph
a paragraph is added at the end of the inserted text.
Why ?
Is there a way to avoid this paragraph mark ?

We are using htm documents because the formatting like bold, italic, ... is
embedded in htm
Are there other/better ways ? Create a word document ?

Thanks
Bart
 
M

Mark Baird

You could test for an empty paragraph mark and delete it
if it is empty.

If Len(ActiveDocument.Paragraphs.Last.Range.Text) = 1 Then
ActiveDocument.Paragraphs.Last.Range.Delete
End If

Mark Baird
 

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