ms-word

Text with different styles in one paragraph Word VBA

三世轮回 提交于 2020-01-24 20:46:08
问题 I want to have bold and not bold text in one line. With objWrdDoc .Styles.Add ("S2") .Styles.Add ("S3") .Styles("S2").Font.Bold = True .Styles("S3").Font.Bold = False End With With objWrdApp.Selection .TypeParagraph .Style = objWrdDoc.Styles("S2") .TypeText Text:="I want to have bold " .Style = objWrdDoc.Styles("S3") .TypeText Text:="and not bold text in one line." End With As a result, the entire text is not bold. 回答1: While working with the Selection object feels "intuitive", it's not as

Office API Javascript - Loading error telemetryproxy.html not found

≯℡__Kan透↙ 提交于 2020-01-24 20:18:26
问题 I tried to load Office.js to my application. I've added the <script src="https://appsforoffice.microsoft.com/lib/1/hosted/Office.js" type="text/javascript"></script> and I get warning and error in console. Warning: Office.js is loaded outside of Office client and Error: o15apptofilemappingtable.js:11 GET https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html 404 (Not Found) I created app.js contains: Office.initialize = function (reason) { $(document).ready

VBA: Within Excel how do I save a word document as a PDF?

元气小坏坏 提交于 2020-01-24 17:11:06
问题 I have some code that copies and pastes data from an Excel file into a word document, how can I get that word document to save as a PDF? My code is as follows: Sub RetailerGraphs() Dim Location As String Dim Detail As String Worksheets("-Summary").Activate Range("AE9").Select While ActiveCell.Value <> "" ActiveCell.Offset(1, 0).Select Location = ActiveCell.Value Worksheets("Detail Summary").Activate Range("B7").Value = Location Dim objWord, objDoc As Object ActiveWindow.View = xlNormalView

MS Office opens documents readonly with WebDAV

删除回忆录丶 提交于 2020-01-24 13:54:05
问题 We implemented our own WebDAV server. Some users having Office (Word, Excel) open documents read-only. On problem computers queries are next: OPTIONS http://pastie.org/10957339, response (after some chain of NTLM auth): http://pastie.org/10957337 (equal to these ones, where problem not reproduces) GET HEAD HEAD Normal queries (on healthy computers) are: OPTIONS, HEAD, LOCK, GET... So, Word do not attempts to LOCK document, and opens it readonly. We have already tried: Checked WebDAV link, it

MS Office opens documents readonly with WebDAV

杀马特。学长 韩版系。学妹 提交于 2020-01-24 13:54:05
问题 We implemented our own WebDAV server. Some users having Office (Word, Excel) open documents read-only. On problem computers queries are next: OPTIONS http://pastie.org/10957339, response (after some chain of NTLM auth): http://pastie.org/10957337 (equal to these ones, where problem not reproduces) GET HEAD HEAD Normal queries (on healthy computers) are: OPTIONS, HEAD, LOCK, GET... So, Word do not attempts to LOCK document, and opens it readonly. We have already tried: Checked WebDAV link, it

How to enumerate word document using office interop API?

点点圈 提交于 2020-01-24 12:25:06
问题 I want to traverse through all the elements of an word document one by one and according to type of element (header, sentence, table,image,textbox, shape, etc.) I want to process that element. I tried to search any enumerator or object which can represent elements of document in office interop API but failed to find any. API offers sentences, paragraphs, shapes collections but doesnt provide generic object which can point to next element. For example : <header of document> <plain text

How to write print css to get print from web pages in almost same manner as we get from MS word?

ぃ、小莉子 提交于 2020-01-24 04:00:57
问题 How to make cross size and cross browser compatible print CSS for World's most use paper sizes to get print? A4, A3, Legal etc How we can same almost similar formatting to our site page's like MS word ? What are best practices to get consistency in formatting of print page from any popular browsers? How to set cross browser margin and font-size with consistency for all like MS word does? Is css font-size unit em best for both screen and print? or we should use pt or px in print css? and i saw

How can I make a part of text bold in an MS Word table cell?

混江龙づ霸主 提交于 2020-01-23 17:46:07
问题 I have a C# application which uses an MS Word document. I have tables where some of the text in a cell needs to be bold . Is there a way to do it? 回答1: I assume you are using Microsoft Office Interop. The example which I found on: http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=48632 says: using Microsoft.Office.Interop.Word; using Microsoft.Office.Core; Document varDoc = varWord.Documents.Add(ref varMissing, ref varMissing, ref varMissing, ref varTrueValue); varDoc.Activate();

What is the fastest way of replacing the text of many content controls via office-js?

怎甘沉沦 提交于 2020-01-23 16:49:26
问题 I wrote the following function to replace a huge amount of CCs with specified values: /** replaceManyCCs() * * Replaces the content of many content controls, based on the replacementObject. * * @arg replacementObject A dictionary. The keys are the titles of the CCs which should be replaced. The values are the replacement values. */ function replaceManyCCs (replacementObject) { Word.run(function (context) { var time1 = Date.now(); // load the title of all content controls var CCc = context

How to delete a section using excel-vba to create a word document

流过昼夜 提交于 2020-01-23 13:07:07
问题 Hello and thank you in advance. I am creating a very complex Word document out of an Excelfile using VBA. It shall be possible to activate something and a text written in a cell shall be transfered to the word document. I got that already done. But if it is not activated the tag "<>" shall be removed, leaving nothing behind. This means that it shall remove not only the text, it shall remove the complete "line". As line might be a section i am not sure if just line is the correct word here.