msword

How do I apply a style to multiple selections in Word using VBA?

I created a macro that will apply a particular style to whatever is selected in the document. However, when in draft view, when the user clicks in the style area pane to select a paragraph and then Ctrl + clicks on an additional paragraph, this additional selection is not applied when this macro is run: Sub BodyTextApply() Selection...

Converting a docx and uploading to sql table.

I have a word document in docx format with data in repeating format pattern. I would like to take each data from the repeating set and upload to a row in the SQL table. Sample of data here: Question No : 1 How is LINQ to SQL different from Entities? A. Answer 1 B. Answer 1 C. Answer 1 D. Answer 1 Answer : D Explanations : Some expl...

Is it possible to call C# dlls from Visual Basic code contained in a Word 2007 file?

I have some Visual Basic methods that are acting as the click handlers for a custom Word Ribbon. Unfortunately, I already have the implementation of what the handlers have to do written in C# which is loaded into the Word document as an XML Expansion Pack. I don't see any way to add a reference to the C# .dlls to Word's Visual Basic Ed...

Custom ActiveX Control Showing Blank Text Box On Load

Hello, The web application im working on uses a custom activex control to load word documents from the database, via word. Currently, however, when i try to load the activex control it instead shows what looks like a large blank text box. I have been pulling my hair out trying to figure out whats going on and i still have no idea. I k...

How to insert color in Word?

How do I insert a text with color. The code below will only insert normal text. oDoc.Range.InsertAfter("Text Input One") ...

How to merge SharePoint List items into Word 2003 document

I want to build a feature like "Print List" on WSS 3.0, and I planned to convert List data into Word document then print it. Is there any way to merge List items into Word 2003 document, I Googled some solutions but they only work with Word 2007. ...

word document open and work on document events throw an error

i am open word document using word(Word 11.0 library , version 8.3) reference. it opens fine. And then i am working on Document events (like DocumentBeforeprint , documentbeforesave ..).at the time the word document DocumentBeforeprint event parameter word.Document DOC throws An error. error is function evaluation time out. my code i...

Copy from Ms Word and paste into Rich Textbox problem

Hi everybody, I have a problem when pasting ms word content into richtextbox. when I copy content of word document and paste it into richtextbox which is in a windows application written in C#. the links are shown like that ; This is test.. Go to Google. <http://www.google.com&gt; Mail : Project <mailto:[email protected]> The issue can a...

Spurious "User-defined type not defined" error in Microsoft Word VBA

I have a Microsoft Word template with some code and some references, that has been working fine for months but has just started throwing up a spurious "User-defined type not defined" error whenever I open it or try to compile it. I know it's a spurious error because I haven't made any significant changes to the code. In fact, I've rolle...

Why do session variables not work properly when following a link from an MS Word document

If you have a link to a webpage in a MicroSoft Word document and you follow this link to get to the web page ASP.Net session variables do not always work as expected. In particular they work the first few times and then later on they stop working. For instance if you have a link to an MVC Page like: http://localhost/Home/TransferToWeb...

Existing Word Document into temporary one

I have a Word document (template) that I want to programmatically modify and than display to the user. I have been able to open the document and modify it but I realized that I was working on the template, while I would like to create a temporary file and work on it. Have you got any suggestion? I tried: myDocument.Contect.Text = Doc...

How do I read a Word doc using the StreamReader?

I have n asp.net 2.0 app. I am trying to upload a file and read lines and display them in a textbox. This works fine for a .txt file. But if I do a word doc, I get all kinds of jibberish (looks like xml-based formatting) surroudning the text. Here is my code... Dim s As New StringBuilder Dim rdr As StreamReader If FileUploa...

insert image in .doc using win32ole library of Ruby

Hi all, As the Title suggests, i am trying to find how to insert image in MS Word(.doc file) using ruby Win32Ole api. I have tried the function InsertFile of Range Object but it seems, it is only made for inserting other doc file in our file in question. Does anyone know anything related to this . It will very helpful. ...

Adding syntax colorized source code into a MS Word document.

I need this for writting a design document. EDIT: Language is C++ and ruby/php/python ...

How can I control "View Whitespace between pages" in MS Word using VBA/Macros?

Is it possible to control the Tools->Options->View->"View Whitespace between pages" through VBA/Macros? Thanks. ...

Trouble displaying MS Word html file in Asp.Net Literal Control

When I display an html file that was created in MS Word, it doesn't render correctly in the ASP Literal control. It seems to have trouble showing tabs, dashes, bullets, etc. Is there something I can do to make this work? ...

How can I store a Word file programmatically in SQL Server 2005 with C#?

I have a button on my form. When the user clicks on the button, Microsoft Word is running. I want to store the file in SQL Server 2005, when the user saves the file. ...

Convert doc/docx to semantic HTML

I would like to convert doc/docx documents to semantic HTML. Some wishes/requirements: Semantic HTML such that headers in the document are <h1>, <h2> etc., tables are <table> and so forth. Should preferably be possible to handle headings, lists, tables and images. Graphs and math formulas is a nice extra. • Doesn't have to be conver...

What is the new line marker in an uploaded Word doc?

I am attempting to uplaod a Word doc and then write it line by line in HTML. I made a referecne to the Microsoft Word Object Library. Then I use the following code to grab the and put it in a string variable. However, I have tried multiple regex statements to replace the new line character with "" but nothing I have tried has worked... ...

convert text with html tag to formated word file

How can i convert the text with html tag to formated word document. Actually what i need to do is, I want to give text with the html tag as input in a text box, and when i click a button, i want the the text to be open in a word document where the html tags are removed and the text appears in its corresponding format. ...