
Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
brokerins is a macro to insert the file code below
Sub insertbrokerins()
'
' insertfile Macro
' Macro recorded 5/9/2006 by Colm O'Brien
'
Selection.InsertFile FileName:="broker installments.doc", Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False
End Sub
> Hi Colm,
>
> what is "insertbrokerins"?
Helmut Weber - 10 May 2006 13:06 GMT
Hi Colm,
With ActiveDocument.Bookmarks("finance")
.Range.InsertBefore vbCr
End With
'---
will not insert a paragraph before the bookmark,
but before the first character in the bookmark. :-(
Try:
Sub test000045()
ActiveDocument.Bookmarks("finance").Select
With Selection
.Collapse direction:=wdCollapseStart
.MoveLeft unit:=wdCharacter
.InsertBefore vbCr
.Collapse direction:=wdCollapseEnd
.InsertFile FileName:="c:\test\test.doc"
End With
End Sub
A solution with range instaed of selection
proofed to be a bit more complicated,
but is certainly doable.
It is assumed, that your bookmark isn't located
at a point in the doc, where .moveleft is impossible.

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
Helmut Weber - 10 May 2006 16:18 GMT
Hi Colm,
from reading your other postings,
it seems, you wanted to insert a vbCr
_in_ the bookmark.
Ask again, if you can't adapt my code to that.

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"