Wrox Programmer Forums
|
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP XML 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 December 29th, 2003, 05:22 PM
Authorized User
 
Join Date: Dec 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to AyatKh
Default urgent need for open an XML with word2003

Hi, I really need some help: The problem is I need to load an xml file into Memory and do search/replace some text in it. after that, I have to spit it out to the browser. I want to open the xml file with word2003. so mostly my file is text but I will save it as an XML file.
Here the code but there are some problem in it. does anybody have any idea? I know that should be an sting at the end.

Thanks
Ayat

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        Dim s, k As String
        Dim xml As New XmlDocument()
        Dim oStream As filestream
        Dim ds As New DataSet()
        Dim filesize As Integer
        Dim ds1 As DataSet
        Response.Clear()
        Response.Expires = 0
        Response.BufferOutput = False
        Response.ContentType = "application/MSword"
        Response.AddHeader("Content-Disposition", "filename=test.XML")


        oStream = New FileStream(Server.MapPath("test.xml"), FileMode.Open, FileAccess.Read)
        filesize = oStream.Length
        Dim Buffer(CInt(filesize)) As Byte

        ds.ReadXml(oStream)
        xml.Load(Server.MapPath("test.xml"))

        s = Replace(ds.GetXml, "test", "test1")

        Response.Write(s)
        Response.End()

    End Sub

End Class

 
Old December 30th, 2003, 12:49 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What seems to be the problem then? Can you provide a bit more detail on what's not working?

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old December 30th, 2003, 01:26 AM
Authorized User
 
Join Date: Dec 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to AyatKh
Default

Hi Peter,
The problem is, when the file is open with word2003, It shows an xml file as a string(which this is not I want). I'm not sure about the object that I used with FileStream and the way that I spit the file out to be opened with word2003. My goal is: having an XML file(word2003 saved as an XML file) Like "This is the test" . Search for "test" and replace it with "test1". have a link that opens the file with word2003 and show me the "This is the test1".
Thank you very much.
Ayat






Similar Threads
Thread Thread Starter Forum Replies Last Post
Xml to XML using XSLT (urgent) naveen_sreepada@yahoo.com XSLT 1 December 30th, 2005 01:48 PM
Extensibility project in c# .NET for Word2003 frenchyyy C# 0 March 22nd, 2005 06:32 PM
Rearranging XML - Urgent. rmiller XSLT 2 October 6th, 2004 03:08 PM
URGENT: automate - OPEN A FILE DIALOG BOX,SELECT chichi120976 Excel VBA 1 December 13th, 2003 05:22 PM
C# with XML. Urgent!Please Help! jayce C# 13 October 10th, 2003 01:43 AM





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