ms-word

How to write an image to an HTML Document set to open in Word

北城以北 提交于 2020-01-06 03:29:46
问题 I am attempting to write an image to an HTML Document that will open in Word from C#. Based on https://stackoverflow.com/a/17082867, it seems like I should be able to just write an image tax with the src set to the image data: <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..." /> However, my file is not working. Word opens and shows a red "X" box with the following message: The linked image cannot be displayed. The file may have be moved, renamed, or deleted. Verify that the

load word file (.docx) in richtextbox

人走茶凉 提交于 2020-01-06 03:08:11
问题 I was already able to load a .docx file into my wpf application but it doesn't seem to show up in my richtextbox: if (openFile.ShowDialog() == true) { // Open document string originalfilename = System.IO.Path.GetFullPath(openFile.FileName); if (openFile.CheckFileExists) { var document = DocX.Load(originalfilename); string contents = document.Text; rtfMain.Document = contents; MessageBox.Show("file loaded"); } } The contents string variable is not accepted by the richtextbox in wpf. Any idea

Prevent Vertically Merged Cells from Breaking Across Page - Automatically

断了今生、忘了曾经 提交于 2020-01-06 02:22:33
问题 I have to create documents that have large tables of data copied into them from Excel. The tables can be hundreds of rows long and generally ~20 columns wide. Many of the columns have been merged vertically to enhance readability and group sets of data. I have been able to write a macro that will fully format the entire table, except I have not been able to figure out how to automatically prevent the Vertically Merged cells from breaking/splitting across multiple pages. To do it manually, you

vb.net Adding Tables to Word Document

两盒软妹~` 提交于 2020-01-06 01:58:06
问题 I am trying to make an application that will take the information entered into the program and generate a quote sheet using Microsoft word. Right now I am having trouble creating tables in the word document. The user can choose to quote between 1 to 4 different products. If 1 product is quoted, then it will create a 6x3 table. If 2 products are quoted, then it will create a 6x5 table with the 3rd column separating the 2 products. If 3 or 4 products are quoted then it will create another table

vb.net Adding Tables to Word Document

自古美人都是妖i 提交于 2020-01-06 01:58:06
问题 I am trying to make an application that will take the information entered into the program and generate a quote sheet using Microsoft word. Right now I am having trouble creating tables in the word document. The user can choose to quote between 1 to 4 different products. If 1 product is quoted, then it will create a 6x3 table. If 2 products are quoted, then it will create a 6x5 table with the 3rd column separating the 2 products. If 3 or 4 products are quoted then it will create another table

Copying text from Word to textarea

房东的猫 提交于 2020-01-05 18:47:12
问题 A well-known problem: When copying text fro MS Word into a textarea, the text's characters get converted to strange characters when saving it to database. I was wondering how I should solve this? Character encoding of the HTML document that holds the form A before save method to sanitize the data Sanitization after retrieving the data (before displaying) A database configuration (character encoding for table) I would prefer if 1. worked, but any other solution will do. 回答1: The solution:

How to remove the entire line of a word doc using vba

為{幸葍}努か 提交于 2020-01-05 16:25:31
问题 The following line of code will insert text into a bookmark range in a word document. objDoc.Bookmarks("DonorAddress").Range.Text = "6200 Main St." How do I remove the entire line containing the address bookmark if I don't have any address data? 回答1: By 'deleting the line' I believe you mean to 'delete paragraph'. If so you could do it in this way: '2 steps to delete- rather not recommended objDoc.Bookmarks("DonorAddress").Range.Paragraphs(1).Range.Select Selection.Delete or in one step:

How to remove the entire line of a word doc using vba

为君一笑 提交于 2020-01-05 16:25:08
问题 The following line of code will insert text into a bookmark range in a word document. objDoc.Bookmarks("DonorAddress").Range.Text = "6200 Main St." How do I remove the entire line containing the address bookmark if I don't have any address data? 回答1: By 'deleting the line' I believe you mean to 'delete paragraph'. If so you could do it in this way: '2 steps to delete- rather not recommended objDoc.Bookmarks("DonorAddress").Range.Paragraphs(1).Range.Select Selection.Delete or in one step:

Paste the copied number in Find dialog box

心不动则不痛 提交于 2020-01-05 14:59:43
问题 Assume I have a list of random numbers like 2,4,6. After searching for 2 I want word to copy number 4 and find 4 in the doc. And then the next number 6. I got everything I need but how to paste the copied number in Find dialog box. Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "2" .Replacement.Text = Selection.Characters .Forward = True .Wrap = wdFindAsk .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False

MS Word - excel cell, “update link” changes format. How to preserve format?

别来无恙 提交于 2020-01-05 14:05:41
问题 I have a MS word paragraph with a few text strings linked to excel cells. When I "update link", the cell loses its formatting, with paragraphs added before and after that cell. Checking the "Preserve formatting after update" option in Word does not seem to work. "Keep source formatting" and "Merge formatting" pasting options give me the same result with this. I checked the source code in Word with alt+f9, and searched for something to add to it { LINK Excel.Sheet.12 "Book1" "Sheet1!R1C1" \a