0
我需要一個帶有一些大膽的詞語的段落,當這使得我在三段中得到結果,並且我需要所有這一切。有沒有辦法做到這一點?word interop solid lines
Microsoft.Office.Interop.Word.Paragraph para1 = document.Content.Paragraphs.Add();
para1.Range.Text = "Dónde puedo conseguirlo";
para1.Range.Font.Bold = 0;
para1.Range.Font.Size = 11;
para1.Range.Font.Name = "Arial";
para1.Range.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphJustify;
para1.Range.Underline = Microsoft.Office.Interop.Word.WdUnderline.wdUnderlineNone;
para1.Format.SpaceAfter = 0;
para1.Range.InsertParagraphAfter();
Microsoft.Office.Interop.Word.Paragraph para8 = document.Content.Paragraphs.Add();
para8.Range.Text = "Lorem Ipsum";
para8.Range.Font.Bold = 1;
para8.Range.Font.Size = 11;
para8.Range.Font.Name = "Arial";
para8.Range.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphJustify;
para8.Range.Underline = Microsoft.Office.Interop.Word.WdUnderline.wdUnderlineNone;
para8.Format.SpaceAfter = 0;
para8.Range.InsertParagraphAfter();
Microsoft.Office.Interop.Word.Paragraph para9 = document.Content.Paragraphs.Add();
para9.Range.Text = " Lorem Ipsum ha sido el texto de relleno estándar de las industrias desde el año 1500, cuando un impresor (N. del T. persona que se dedica a la imprenta) desconocido usó una galería de textos[enter image description here][1].";
para9.Range.Font.Bold = 0;
para9.Range.Font.Size = 11;
para9.Range.Font.Name = "Arial";
para9.Range.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphJustify;
para9.Range.Underline = Microsoft.Office.Interop.Word.WdUnderline.wdUnderlineNone;
para9.Format.SpaceAfter = 0;
para9.Range.InsertParagraphAfter();
您試過'para8.Range.Font.Bold = true'嗎? – DDave
para8.Range.Font.Bold is int not bool –
當Word互操作需要int而不是bool時,將-1用作「true」。 –