Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2004

Tip: Looking for answers? Try searching our database.

How to use Word form on the web?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
OceanDesigner - 15 Nov 2004 22:53 GMT
I have a web page written in a web application to take data and submit it to
a database.  Once the data is submitted, I want to copy those values from
either the initial web form or from the database and put them into a form I
have created in Word.  I can get the data submitted to the database, and I
can open the Word document, but I cannot figure out how to get the data into
the Word form.  This would be easy if it were another ASP, but I can't figure
out how to do it with a DOC.

I have tried to do it from the opener (the initial web page, which opens the
Word document) - it would find the bookmark and enter the appropriate value.  
I have also tried to code the Word form directly to go get the data from the
database.  I have not been succesful using either approach.  Can I please get
a simple example of how this is done?

Thanks -Jeff
Doug Robbins - 16 Nov 2004 02:51 GMT
I would dump the data into document variables using

ActiveDocument.Variables("varname").Value = [data from webpage]

then to have it displayed in the document, you would use a { DOCVARIABLE
varname } field which you would already have in the document (or template)
and you use an

ActiveDocument.Fields.Update

command to update the fields so that they display the values assigned to the
variables.

If any of the data is to go into the headers or footers of the document, you
will need to access the .Range of each header or footer in the document and
update the fields in it using

For i = 1 to ActiveDocument.Sections.Count
   ActiveDocument.Sections(i).headers(wdHeaderFooterPrimary).Range.Fields.Update
   'repeat for each footer and headerfooter type
Next i

Alternatively, see the article "Access a database and insert into a Word
document the data that you find there" at:

http://word.mvps.org/FAQs/InterDev/GetDataFromDB.htm

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

>I have a web page written in a web application to take data and submit it
>to
[quoted text clipped - 19 lines]
>
> Thanks -Jeff

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.