Results 1 to 5 of 5

Thread: gettin data to word doc

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Posts
    117

    gettin data to word doc

    hi everyone!

    i have an app that supose to print stamps (3 in a row)
    i want to know how to put the data from the database to the word doc thats opens by clicking on button on the app

    on the word doc i put textboxes but i want to know how can i create 3(section of textbox fill with diffrent data from database) in a row

    hope i got my self right


    i know i can do it with crystal-report, but i want to know how to do it with word?


    thank you
    thank you
    sharon

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Set Bookmarks in your Word document, and then use code similar to this (which I just pulled out of one of my projects) to pass text in a VB textbox to the bookmark on the word document.
    VB Code:
    1. Dim WordObject As Word.Application
    2. Set WordObject = CreateObject("Word.Application")
    3.  
    4.      With WordObject
    5.      .Documents.Open ("c:\program files\qcap\transmove.doc")
    6.      .ActiveDocument.Bookmarks("transtype").Select
    7.      ' reapply the boomark name to the selection
    8.      '.ActiveDocument.Bookmarks.Add Name:="First",Range:=Selection.Range
    9.      .ActiveDocument.Bookmarks("fromlocation").Select
    10.      .Selection.Text = (lblMoveFrom.Caption)
    11.      .ActiveDocument.Bookmarks("tolocation").Select
    12.      .Selection.Text = (lblMoveTo.Caption)
    13.      .ActiveDocument.Bookmarks("numbers").Select
    14.      .Selection.Text = (txtStatus.Text)
    15.      .ActiveDocument.Bookmarks("preparedby").Select
    16.      .Selection.Text = (UCase(UserAccount))
    17.      .ActiveDocument.Bookmarks("comments").Select
    18.      .Selection.Text = (txtComments.Text)
    19.      .ActiveDocument.Bookmarks("movedate").Select
    20.      .Selection.Text = (Today)
    21.     End With

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Posts
    117

    allocate bookmark

    hi

    thank you for the code its great but


    what i am doing if if the user choose adress between 2000 to 3000 , i have 1000 stamps to put on the word
    how can i do it, if for my understanding i have to build the bookmark first?
    thank you
    sharon

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    So, are you talking about 1000 individual stamps?

    What do you mean by stamp, by the way? I assume you aren't talking about postage stamps.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Posts
    117
    sorry, i mean stickers!


    and yea i mean 1000 individual stickers that i want the word to show me ?

    example:

    to : 20676
    Mr david saban
    honelolo st
    new york


    like this 1000 individual stickers!


    maybe i can do it with somthing else



    sorry for the missunderstanding
    thank you
    sharon

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