Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.††If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 6th, 2004, 10:50 AM
Authorized User
 
Join Date: Jun 2003
Location: Noida, UP, India.
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access XML fragments embedded in Word 2003

Hi Friends,

I'm stuck up in an app...I have different XML file contents in a Word 2003 document(Actually contents from different XML files are inserted into the Word doc one at a time...These are called Fragments). I need a way in .NET(C#) where I can iterate through all these Fragments and then after getting these fragments into a collection, I be able to access the properties of these Fragments(XML file contents) like the path of the XML fragment, any XSL that is applied to that fragments, LastModified Date of the fragment, etc.

Can somebody help me in this? Can I use the Word Object Library 11.0 to get a collection of XML Fragments inserted in a Word 2003 document? I basically need to loop through all the XML Fragments placed in the Word 2003 doc and store information about these fragments...
Any help on this will be greatly appreciated.

Thanks
Debsoft
__________________
cheers,
debsoft
Reply With Quote
  #2 (permalink)  
Old May 6th, 2004, 12:04 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

You can use the Word object library to access information in a document, through the Document class. To retrieve the XML from the rest of the document you could then use Regular expressions to pull them out of the document text.

You may even see if you could save it as a text file and parse it that way, I don't know if that would be easier to do.

Brian
Reply With Quote
  #3 (permalink)  
Old May 7th, 2004, 07:55 AM
Authorized User
 
Join Date: Jun 2003
Location: Noida, UP, India.
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Brian,

Thanks for your reply. It's true that I can use the Word Object library to access info in a document. There are different objects collection in Word Library like Application, Document, Selection, etc.
Actually, the problem that I'm facing is --- I have certain fragments (XML file contents) in a Word Document. I'm able to open those fragments in InfoPath 2003 and edit it. Now when I close the InfoPath window, the updates done to the fragments in the InfoPath window should show up in the Word Window. Now for that I need to know which fragment user had clicked, that is, I need some way of associating each fragment in the Word doc with the path of the XML file from where it came. I tried to find if there exist any collection which will allow me access to these fragments and also their properties but there ain't any such object in Word 2003 Object Model....That's the big problem(the association)....Anyway thank for ur reply...if u come across any object collection which can solve the above purpoae do let me know.

Thanks,
Debsoft


Quote:
quote:Originally posted by bmains
 Hello,

You can use the Word object library to access information in a document, through the Document class.††To retrieve the XML from the rest of the document you could then use Regular expressions to pull them out of the document text.

You may even see if you could save it as a text file and parse it that way, I don't know if that would be easier to do.

Brian
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract embedded documents in the word document ayyanarj General .NET 0 August 31st, 2007 12:32 AM
how to access with code-behind a label embedded in hertendreef ASP.NET 2.0 Basics 3 March 12th, 2007 06:47 AM
Getting images embedded in Word aniket123 Word VBA 0 February 27th, 2006 05:24 AM
Word 2003 bmains ASP.NET 1.0 and 1.1 Professional 0 May 2nd, 2004 06:40 PM
Invoking Word 2003 document from InfoPath 2003 debsoft General .NET 0 April 28th, 2004 08:17 AM



All times are GMT -4. The time now is 12:49 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.