ms-word

Adding image with docx4j to doc file

蓝咒 提交于 2020-01-16 19:25:33
问题 I'm trying to add an image to a docx file using docx4j library within Android. I've faced to an exception: E/AndroidRuntime(21818): java.lang.ExceptionInInitializerError E/AndroidRuntime(21818): at org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.newSource(AbstractImageSessionContext.java:134) E/AndroidRuntime(21818): at org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.needSource(AbstractImageSessionContext.java:280) E/AndroidRuntime(21818): at org

Keep Microsoft Word from adding files opened programmatically to its History

折月煮酒 提交于 2020-01-16 18:41:09
问题 I have a .NET program that opens a file programmatically in word to modify it. Unfortunately, Microsoft word keeps the times the file was opened in word in its History, even though I don't want that to happen when the file is opened programmatically. How can I keep this from happening in .NET? 回答1: If you are using Documents.Open or SaveAs you can set the AddToRecentFiles property like this: Open: Globals.ThisAddIn.Application.Documents.Open("filename", AddToRecentFiles: false); Save as:

Can a character style be applied programmatically to a string before it is written to the Word document with VBA?

青春壹個敷衍的年華 提交于 2020-01-16 16:57:23
问题 I am grabbing some data from an Excel sheet and populating it into a Word template. I'm hoping that I can assign some of the Document's character styles to sub strings that will be added to the Document as the string is built up rather than having add the string to the Document and then select each string individually to apply the appropriate style. Right now, I'm concatenating a few strings and adding them to a text box in the document like this: ActiveDocument.Shapes("Text Box 7").TextFrame

Inserting formatted numbers as text in Right to Left MS-Word document

对着背影说爱祢 提交于 2020-01-16 13:14:28
问题 I have sValA = 10/140/000 string. Need inserting 10/140/000 as text in a right-to-left document. When I performs below ThisDocument.Bookmarks("Temp_GrandTotal").Range.Text = sValA It returns 000/140/10 Any helps are appreciated. 回答1: You can add a UDF to swap the parts by a swap character. Then call it like: ThisDocument.Bookmarks("Temp_GrandTotal").Range.Text = SwapParts(sValA,"\") UDF code: Option Explicit Function SwapParts(ByVal sText As String, ByVal SwapChar As String) As String Dim

Resizing image in word using Excel VBA

左心房为你撑大大i 提交于 2020-01-16 10:02:10
问题 I have this code in excel VBA that creates a word document and paste my screenshot. What I want to do next is to resize the image so i can fit more images in a single page, unfortunately I really don't know what to do next after I paste the image Sub Testing() Dim wrd As Word.Application Set wrd = Word.Application With wrd .Visible = True .Activate .Documents.Add Call PrintScreen .Selection.Paste 'What should i do next? end with End Sub 回答1: You can constrain the size of pictures inserted

ASP .NET / VB .net Using Microsoft Interop Word - CreateObject(“Word.Application”) Crash

我是研究僧i 提交于 2020-01-16 09:14:09
问题 I'm just trying to fill a word dot file (using bookmark) with my asp net vb net webform site using Microsoft Interop Word. It works perfectly in debug on my IIS Express, but crash on my Windows Server 2016 / IIS 10. Dim oWord As Word.Application oWord = CreateObject("Word.Application") Server crash with message like this : Cannot create ActiveX component. (original error message : Impossible de créer le composant ActiveX.) I was searching for a fix, but a lot of post about this error are old.

ASP .NET / VB .net Using Microsoft Interop Word - CreateObject(“Word.Application”) Crash

青春壹個敷衍的年華 提交于 2020-01-16 09:13:13
问题 I'm just trying to fill a word dot file (using bookmark) with my asp net vb net webform site using Microsoft Interop Word. It works perfectly in debug on my IIS Express, but crash on my Windows Server 2016 / IIS 10. Dim oWord As Word.Application oWord = CreateObject("Word.Application") Server crash with message like this : Cannot create ActiveX component. (original error message : Impossible de créer le composant ActiveX.) I was searching for a fix, but a lot of post about this error are old.

How to retrieve the Query string value from web word instance

↘锁芯ラ 提交于 2020-01-16 08:44:07
问题 I'm creating a web add-in for Word targeting Word Online. When a document is opened using Word Online, the URL will contain a file name. I am trying to retrieve that file name. To retrieve this URL I tried using window.location href, but it is fetching my hosted addin web application URL. Is it possible to get the Word Online URL? Sample Code : function getParameterByName(name, url) { if (!url) url = window.location.search; name = name.replace(/[\[\]]/g, '\\$&'); var regex = new RegExp('[?&]'

How to use VBA to say 'Yes' to any SQL prompts in word?

房东的猫 提交于 2020-01-15 15:44:08
问题 I'm using a macro, launched from a word document, which opens, executes, and closes a series of other documents, each of which contains a macro that executes a mail merge. The code works fine, but each time the new document is opened, I am given an SQL prompt, asking if I want to put the data into my document from the datasource. I can just say 'Yes' to all of these dialog boxes, but a) I would like to automate this to make it easier b) Other users might also use this document, and I don't

Export discontinuous range of pages to PDF

旧城冷巷雨未停 提交于 2020-01-15 10:17:32
问题 I am trying to save a Word template in .pdf format. I need to print the following range (1-3,18). The problem is that using "ExportAsFixedFormat2" does not allow me to select that range or at least I dont know how: wdapp.ActiveDocument.ExportAsFixedFormat2 OutputFileName:=savenamepdf, ExportFormat:=wdExportFormatPDF, Range:=wdExportFromTo, From:=1, To:=3 If I use "printout" I can select the range and create the pdf file, but when I try to open it I get an error message like it is broken or