|
-
Aug 13th, 2002, 07:41 AM
#1
Thread Starter
Lively Member
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
-
Aug 13th, 2002, 07:51 AM
#2
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:
Dim WordObject As Word.Application
Set WordObject = CreateObject("Word.Application")
With WordObject
.Documents.Open ("c:\program files\qcap\transmove.doc")
.ActiveDocument.Bookmarks("transtype").Select
' reapply the boomark name to the selection
'.ActiveDocument.Bookmarks.Add Name:="First",Range:=Selection.Range
.ActiveDocument.Bookmarks("fromlocation").Select
.Selection.Text = (lblMoveFrom.Caption)
.ActiveDocument.Bookmarks("tolocation").Select
.Selection.Text = (lblMoveTo.Caption)
.ActiveDocument.Bookmarks("numbers").Select
.Selection.Text = (txtStatus.Text)
.ActiveDocument.Bookmarks("preparedby").Select
.Selection.Text = (UCase(UserAccount))
.ActiveDocument.Bookmarks("comments").Select
.Selection.Text = (txtComments.Text)
.ActiveDocument.Bookmarks("movedate").Select
.Selection.Text = (Today)
End With
-
Aug 13th, 2002, 09:07 AM
#3
Thread Starter
Lively Member
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?
-
Aug 13th, 2002, 12:12 PM
#4
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.
-
Aug 14th, 2002, 02:31 AM
#5
Thread Starter
Lively Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|