FaheemAhmadGul
asked on
Inserting Text From Another Word Document
I would like to insert text into my currently open word document from another word document on one of my hard disk through the click event of a Button on my Form.
The following line of code does this for me.
Private Sub BringText_Click()
ChangeFileOpenDirectory "G:\My Folder\"
Selection.InsertFile fileName:="Test Document.doc", Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False
End Sub
However the above code brings the whole of the Text Document into my Word Document. I would like to modify the above code such that it brings only the first paragraph from the "Test Document" into my currently open Word Document. I would appreciate your help with this. Thanks.
The following line of code does this for me.
Private Sub BringText_Click()
ChangeFileOpenDirectory "G:\My Folder\"
Selection.InsertFile fileName:="Test Document.doc", Range:="", _
ConfirmConversions:=False,
End Sub
However the above code brings the whole of the Text Document into my Word Document. I would like to modify the above code such that it brings only the first paragraph from the "Test Document" into my currently open Word Document. I would appreciate your help with this. Thanks.
Private Sub BringText_Click()
ChangeFileOpenDirectory "G:\My Folder\"
Selection.InsertFile fileName:="Test Document.doc", Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Many thanks. My apologies for the delay in accepting the solution. I did not realise it has been posted because this time I did not receive any email to let me know that a comment has been posted on my question on the forum.
Open in new window