Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass variables from web page to word doc?

Status
Not open for further replies.

ttrinh

MIS
Jan 21, 2002
93
0
0
AU
Hi
Is it possible to pass variables from a webpage to a Word template? Also create a database connection from the word templatew so that it knows what to display when it gets the variables? I have seen Microsoft Access connection capability from Word but is it possible from an oracle db?

Thanks!!
 
ttrinh,

Q: Can you pass input data from a webpage to a Word template?
A: Yes you can, but not directly to the best of my knowledge. You are looking at a fair amount of VBScript/WSHscripting to accomplish it, and you will either have to store the data in a database (using ADO) or a text file (using Filesystemobject).

Note: If all of your users will ALWAYS only access the site using IE, you could develop ACTIVEX COM and embed in your webpage. Found a ref on MS site. See below.

Q: Is is possible to connect to Oracle DB like you can from Access?
A: Yes. However, you need the ODBC drivers installed on the system that you will be running the app on, presumably your server. May already be there. Try going to your DATA SOURCES ODBC and check under DRIVERS. If you already have one for ORACLE then your in business, otherwise you will need to get a copy. Could be a licensing issue.

Q: Can we pull information from a database (Oracle or whatever) and use that to feed fields in the Word template?
A: Yes. Will take a moderate amount of programming.

Some sites for reference:

Hope this helps.

DougCranston
 
DougCranston,
Thanks for your reply
I am planning to create the webpages as jsps. Is there any restrictions creating ActiveX or COM objects? (You can prolly tell I am newbie here)
Also I do have the Oracle driver and have created the DSN for the database but how do I create the connection in the Word template?

I have looked at the sources you pointed out but I don't really get them - some background... What I want to do is send info whether its a record or dataset to a format that is printable ,where the format/layout is of importance (invoices). I am not sure if what I am asking is the best way to go about what I want

Thanks again
 
ttrinh,

Where to start..

Question for you. You said "create the webpages as jsps". Does jsps mean Javascript or are you referring to Java? Or something else?

Q: restrictions creating ActiveX or COM objects?
A: No, but they are normally created using VB6, VB.NET, C++, or C# etc. The one reference pointed to an example at MS site. If you are a newbie, then odds are your not into fullscale coding. So, shortest route if that is the direction you need to go is to contract that out. If I am making a bad assumption of your programming skills/training, then I apologize, but based on your notes, that was an assumption I made.

Q: Send output to print. Invoice?
A: Word can format the output. Suggestion is to check out Helen Feddema's site at:
Specifically look at Archon's 44, 55, 65,

Also, check: Code Samples 2, 3, 9, 24, 25, 35

These are well documented and she is a respected author and expert in Access.

Hope this helps out.
DougCranston
 
Thanks again for your responses DougCranston,
that is alright I really am a newbie here
but I have certain restrictions .. I am unable to outsorce and by jsp I mean java server pages with an oracle backend .
I have found out how to connect to the oracle datasource but next challenge is to pass the parameters from the web pages and into word using macros (correct me if I am wrong here). Is there something that needs to be set up for the Word template macro to be able to read the parameters ?

The links you have pointed me to are very helpful : ) I'm assuming the last FAQ How to instructions on the VBA code can be ported to VB in the Word template?
 
ttrinh,

Not sure I can be of much more assistance. My familiarity of Word templates is limited.

And although I have seen info on the web and other sources on using VBScript in an ASP page or from just a WSH script to feed information into a Word Document/template, I have not done it myself.

Best I can offer you now is just a few more references and hope they can get you over the remaining hurdles.

"Dynamically Writing Office Documents" at

Provides a brief example of how VBScript can take elements off of a web page, or just as easily take data from a database.

"A Sample Oracle ASP Application"

Although this example pulls data from Oracle DB and populates an HTML code table, with some changes you could use it to create or populate a Word Template.

Suggest searching Google, with search terms like:

asp word oracle
asp word object

Goodluck.
DougCranston
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top