Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
| Search | Today's Posts | Mark Forums Read
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 4th, 2003, 08:21 AM
Registered User
 
Join Date: Jun 2003
Location: Battle Creek, MI, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default importing a newly created Word obj into SQLServer

Hello All,
I am trying to create a Word document on the fly in VS.NET and then import it into a SQLServer 2000 database. I want to do it without having to save the doc object as a file on a server. I've tried using the Stream object, FileStream object, MemoryStream object... I can't figure out how to make any of it work. I'm assuming I need to save it as an image field in the database, but I can't make it happen. Here's how I've started:

        Dim oWord As Word.Application
        Dim oDoc As Word.Document
        Dim oPara As Word.Paragraph
        oWord = CreateObject("Word.Application")
        oWord.Visible = True
        oDoc = oWord.Documents.Add
        oPara = oDoc.Content.Paragraphs.Add()
        ...
        [code to build out document]
        ...

I know that I have succesfully created a doc because I can save it to a directory on the server, but I don't want to store this on the server. What can I do next to successfully get this document object into SQLServer 2000 without first saving it to the server?



Thanks,

Scott
 
Old June 30th, 2003, 04:44 PM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Scott- certainly this isn't my area of expertise. However can you use something like oDoc.Content to see the whole file? Perhaps if you write the contents of oDoc.Content out to SQL server that would work.

Hal Levy
NOT a Wiley/Wrox Employee- Got a job for me?




Similar Threads
Thread Thread Starter Forum Replies Last Post
Placing existing control in newly added container morbidreich Beginning VB 6 1 December 27th, 2007 11:14 PM
SQLserver 2000 vs SQLserver 2005 Express cJeffreywang BOOK: Beginning ASP.NET 2.0 and Databases 0 April 22nd, 2007 09:52 AM
Why not seperate OBJ layer susahin80 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 January 19th, 2007 03:51 PM
How to retrieve ID field of newly-created record Steve777 Classic ASP Professional 3 October 2nd, 2006 11:27 AM
How to Use Precompiled OBJ johan_yo Visual C++ 2 July 26th, 2003 02:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.