PDA

View Full Version : Inserting text from a different file into a template



Chukesgirl
07-17-2008, 10:27 AM
I'm sure this is pretty easy, but I have never done it before in Word. I am creating a template in Word 2007 and I have a custom dialog box that has 2 options. Depending on which option the user chooses, I would like to select a paragraph of text from a separate Word document on the c drive and then place that text into a bookmark in my template document. Can someone give me an example(s) on how to do this? Thanks.

lucas
07-20-2008, 05:39 AM
Why not have both paragraphs already in the template and delete the one you don't want using your dialog box or radio buttons?

Read it all but pay strict attention to the attachment in post #11

http://vbaexpress.com/forum/showthread.php?t=13543

Solrac3030
05-04-2009, 03:36 PM
Try This to get the paragraph you want to your document.

ActiveDocument.Bookmarks("Name").Select
Selection.InsertFile FileName:="C:\File.doc", _
Range:="BookmarkName", ConfirmConversions:=False, Link:=False, Attachment:=False

Name is the name of the Text Form Field you are using or Bookmark you are using where you are going to put the paragraph in.

The BookMarkName is the BookMark name you gave the paragraph in the other document. So depending which option you select will determine which bookmarkname you use.

fumei
05-20-2009, 11:08 AM
Another option is to use an INCLUDETEXT field.