Results 1 to 2 of 2

Thread: Populating data in Headers as well as the body of the document.

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2008
    Posts
    1

    Populating data in Headers as well as the body of the document.

    Hi

    I am working on an XP workstation using Microsoft Office 2003.

    I am running a VB Module and front end form ( I use the form to collect data such as name and number). I use bookmarks in my word document to place the collected data on the Word documents where the bookmarks are located. This process works fine. I have recently been tasked to combine 15 documents, with varying pages, into one document. Some of these document collect the data from the header and some collect the data from the body of the document. I have been able to combine all of the documents together and maintain the formatting of each. My problem is that need a way to replace the collected data in both the body or the header. Please find below an example of the code I am using to place data on the document. If more information is needed please let me know.

    With ActiveDocument
    .Bookmarks("name").Range.Text = namevar
    .Bookmarks("number").Range.Text = idvar
    .Bookmarks("DOB").Range.Text = Adatevar
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
    frmInputData.Hide
    ' End If ' Ends the Test for blank fields
    ' Go to the end of the Document and prepare for note entry
    Selection.GoTo What:=wdGoToLine, Which:=wdGoToNext, Name:=1
    End Sub

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Populating data in Headers as well as the body of the document.

    Thread moved to Office Development/VBA forum (note that the "VB Editor" in Office programs is actually VBA rather than VB)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width