ms-word

How to Copy/Paste text box from MS Word to Powerpoint slide?

最后都变了- 提交于 2019-12-25 06:22:00
问题 I am currently creating a document that will take the format and text from a MS Word document and paste it into a text box in a PowerPoint template. I have looked all over to see how this can be done and haven't found much. Any help would be much appreciated!! Public Sub CommandButton1_Click() Dim pptApp As Object Dim pptPres As String Dim folderPath, file As String folderPath = ActiveDocument.Path & Application.PathSeparator file = "Huntington_Template.pptx" pptApp.Visible = True pptApp

How to build custom sentences with OpenXML

醉酒当歌 提交于 2019-12-25 05:16:16
问题 I would like to know if there is a way to "play" with sentences in a .docx. Here's what I need to do: I have a paragraph in a document exemple of my paragraph: This is a paragraph that I need to format based on some conditions and I can't figure how to do this with openxml sdk. end of exemple. So based on a condition that I evaluate in c# I would like to add/remove the text. Another thing that you should know id that I would like the product owner to change the text of the document. Basicly

OfficeJs/WordJs select text range by index and bind click event

醉酒当歌 提交于 2019-12-25 04:21:45
问题 First , Using OfficeJS/WordJS how can I select text in a paragraph by index and length. For example, my paragraph has 100 characters and I need to select all from index 2 till index 16. Second , When I found this range - how I can add an event handler for this range? I mean, when user click at 2-16 chars in my paragraph - I will show some useful information in my Add-in. I'm using Word 2016 Add-in. Thanks! 回答1: I recommend you to explore the Range functionalities we added as part of the 1.3

How to Extend Selection to whole paragraph via VBA

∥☆過路亽.° 提交于 2019-12-25 04:11:43
问题 I am using this code to extend selection to whole line on word document, Now I want to extend selection to whole paragraph Selection.Expand wdLine 回答1: Try using a different WdUnit like wdParagraph: Selection.Expand wdParagraph See this link for an overview of the different WdUnits: https://msdn.microsoft.com/en-us/library/office/ff838950.aspx 回答2: If you know one of the enumerated values then you can use the Object Explorer to find the name of the Enumeration. By referencing the Enumeration

Embed a file into a Word doc using VBA

我与影子孤独终老i 提交于 2019-12-25 03:49:19
问题 I am attempting to do this from Access 2010 using Word 2010. I have a WordDoc object and cannot find a way to embed a file. I tried starting from nothing using a bookmark: bmFile.Range.InsertFile "C:\Users\Me\Desktop\TestFile.xlsx" and that trew an error about the File being corrupted. I tried editing an existing embeded file using WordDoc.InlineShapes(1) but no properties were changable or relevant. Any ideas would be greatly appreciated. Thanks 回答1: From an existing file (as per your

Word/Publisher email merge issues

落爺英雄遲暮 提交于 2019-12-25 03:47:35
问题 I've been searching for days for an answer to this issue. I'm trying to append an Access field to a base URL to customize each email in my merge like so: http://www.example.com/myItems.asp?ItemID={field}. I tried several approaches in Word 2007, then gave up and finally tried Publisher after coming across this post - MS Word: Mailmerge hyperlinks with query get URL string with a MERGEFIELD. In Publisher, I got everything to merge properly including the custom links (according to preview), but

Setting correct printer in MS Word through automation

与世无争的帅哥 提交于 2019-12-25 03:43:33
问题 I have the following automation code: lPrintSetup := fWordObject.Application.Dialogs.Item(wdDialogFilePrintSetup); lPrintSetup.Printer := 'MyPrinter'; lPrintSetup.DoNotSetAsSysDefault := True; lPrintSetup.Execute; lPrintSetup := Null; The Printer property is giving me some problems, sometimes Execute crashes with an EOleException (0x800A1460 (error code 5216): There is a printer error) because of a wrong printername. I have printer information of all printers in a _PRINTER_INFO_2 record which

Search And Replace Text in OPENXML (Added file)

假如想象 提交于 2019-12-25 03:34:38
问题 I know there is alot of posts on it, BUT nothing worked for my problem: Im using OPENxml to create word document, and I am adding some ready files to the document during the creation. I want to change some text in the file that I am adding after the document is ready. So thats what I tried: First creating the document: fileName = HttpContext.Current.Server.MapPath("~/reports/"+fileName+".docx"); using (var doc = WordprocessingDocument.Create( fileName, WordprocessingDocumentType.Document)) {

How can I calculate the sum of Legacy Form Fields without werid scrolling?

二次信任 提交于 2019-12-25 03:34:30
问题 I have a Word document with a table that contains the price of an item, the order amount and the item sum, where amount and item sum are Legacy Form Fields: There are other items available as options that you can chose via checkbox (also Legacy Form Fields): Code Now I've created a function that calculates the item sum Sub order_amount_Click() Dim amount As Integer Dim valueFromCell As String Dim list Dim value As Double amount = ActiveDocument.FormFields("order_amount").Result If amount > 0

How to Expose Listbox in UserControl in CustomTaskPane VSTO C#

泄露秘密 提交于 2019-12-25 03:33:12
问题 I am creating an application level add-in for Word 2010 using C# VSTO. I created a User Control, placed controls within it, and then used the User Control to add a Custom Task Pane: UserControl myUserControl; myUserControl = new PageElementsPane(); mytaskPane = this.CustomTaskPanes.Add (myUserControl, "Page Elements", doc.ActiveWindow); So far so good. However, the User Control contains a listbox that I have not been able to access after the Custom Task Pane is added to the Custom Task Pane