Word template to be filled by the server in aspnet

S

sweetpotatop

Hello,

I wonder how I can populate the fields of a Word template in asp.net.
Please note that data will be coming from a DB on the server.

Thanks in advance.
 
S

sweetpotatop

I have a word template in which I define lots of bookmark (textbox for
user input).

I am going to populate those bookmark or texboxes with info from a
Database, and display it to the user.

How can that be done? Since I won't be able to use
CreateObject("Word.application") due to permission issue.

But on the client-side script, I can't do it either, as I don't know
how I can pass my DB data from the server to the client.

Can I do it through XML, but I am a newbie.. Please help!

Thanks in advance. Your help would be greatly appreciated.
 
T

Terry Burns

What is the permission issue ?, using COM is probably going to be what you
will use. Alternatively, if you are using 2005 an Word 2003 + you can use
code-behind.
 
S

sweetpotatop

Hi Terry,

The permission issue is I have to create an ASPNET account and grant
permission to that account for accessing the Word.Application object!
 
S

sweetpotatop

I read your second link, which is a really good solution, however, I
have around 5-10 files for each account (users) and the content/data in
the file is client-specific, which means I have tons and tons of files
sitting on my sever if I am going to save them before I send to the
client's brower. Is there a way for clean up?

Thanks in advance.
 
S

sweetpotatop

Btw, I got the following error when I tried to open my word document:

System.Runtime.InteropServices.COMException: Could not open macro
storage.

Code:
oDoc = oWord.Documents.Add(tempPath & tempName & ".doc")

Is there a way to skip creating an user account in the server, as I
know this is not a good practice.

Or can I do this in some other way, like xml, but my document is in
Word format, with grids...


Thanks in advance.
 
G

Guest

If you're going to attempt COM Interop with Office on the web server (which
is not recommended) then you're going to have to deal with security issues
such as needing a valid user account.

--
I hope this helps,
Steve C. Orr
MCSD, MVP
http://Steve.Orr.net
 
S

sweetpotatop

I prefer not doing that way, that's why I wonder if I can do it through
xml. However, my original template is in Word. With grids, bookmarks. I
convert it into xml, however, how can I populate the bookmarks with
data in aspnet and push to the browser of the client?

Any quick and easy way please? All I want is to populate my Word
template and show to my client!

Thanks in advance. Your help would be greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top