vsto

Word VSTO - Why paraId is sometimes missing

℡╲_俬逩灬. 提交于 2019-12-20 06:25:22
问题 I'm retrieving paragraph stylenames from openXML and using paraID property to get the right one. During testing i noticed that depending on the word document the attribute might not be present on any of the paragraphs. I do know that this is a internal runtime paragraph id for Word. So the question is: What generates the paraId properties on the paragraphs, can't seem to figure this out. ps. I don't want to use get_style() since that is waay too slooooow... edit: added code example This is in

How to load/unload Word Add-in programatically?

我的未来我决定 提交于 2019-12-20 05:53:14
问题 I'd like to know how I can programatically load and unload a VSTO add-in in Word. I'm using Word 2007 and VS2010 with C#. I thought I might have some luck with using the Microsoft.Office.Interop.Word.COMAddins and .Addins properties, but the .Addins property gives an empty list and COMAddins is a collection of opaque COM objects. An alternative question suggests making the ribbon menu invisible, but I actually want to unload the add-in altogether. 回答1: I had similar requirement and achieved

Word VSTO - Filling a shape does not work in Word 2010 and Word 2013?

心已入冬 提交于 2019-12-20 05:46:09
问题 I use the following VB.NET (VSTO) code to add a shape in MS-Word, Dim app As Word.Application = Globals.ThisAddIn.Application Dim doc As Word.Document = app.ActiveDocument Dim left As Single = CSng(Convert.ToDouble(app.Selection.Information(Word.WdInformation.wdHorizontalPositionRelativeToPage))) Dim top As Single = CSng(Convert.ToDouble(app.Selection.Information(Word.WdInformation.wdVerticalPositionRelativeToPage))) Dim shape As Word.Shape = doc.Shapes.AddShape(1, left, top, 225.1F, 224.5F)

Set Excel Named Ranges via C#?

空扰寡人 提交于 2019-12-20 04:25:14
问题 I'm trying to replicate this Access VBA code using C#, but am unable to do so. Wondering if anyone else has tried this before and can help. oWB.Worksheets("Signoff").Range("rgSignOffRecTemplate").Value = g_TemplatePath & "Signoff_Rec.XLT" rgSignOffRecTemplate is a "Defined Name" in the Excel template that I'm trying to write to. Many thanks for your help. 回答1: private void ThisWorkbook_Startup(object sender, System.EventArgs e) { Excel.Name oName; Excel.Range oRange; //'using name oName =

How to customize save behaviour in Word using VSTO

浪子不回头ぞ 提交于 2019-12-20 03:53:22
问题 Fundamental question on how to get the bits to work together: I've not used VSTO before and after 4 hrs of searching I've decided to ask! I want to create a simple AddIn for word that will execute when the user saves ANY document. I thought all I would need to do would be to create an AddIn in VisualStudio 2008, and put my code in the ThisAddIn class Public WithEvents objWordApp As Word.Application Private Sub objWordApp_DocumentBeforeSave(ByVal Doc As Word.Document, ByVal SaveAsUI As Boolean

VSTO Powerpoint Notes Page - Different colored words on same line

Deadly 提交于 2019-12-20 03:16:46
问题 I am trying to insert content into the Notes Page of Powerpoint programmatically. There will be different colored text on the same line. I have only gotten it to work via paragraphs, but doing so will make them appear on different lines. This is what I have tried: var slideRange = Application.ActivePresentation.Slides; slideRange[1].NotesPage.Shapes[2].TextFrame.TextRange.Paragraphs(1).Font.Color.RGB = Color.Black; slideRange[1].NotesPage.Shapes[2].TextFrame.TextRange.Paragraphs(1).Text =

F# Excel Range.Sort Fails or Rearranges Columns

允我心安 提交于 2019-12-20 01:39:57
问题 I have two cases. The preliminary code: open Microsoft.Office.Interop.Excel let xl = ApplicationClass() xl.Workbooks.OpenText(fileName...) let wb = xl.Workbooks.Item(1) let ws = wb.ActiveSheet :?> Worksheet let rows = string ws.UsedRange.Rows.Count First, I try the following to sort: ws.Sort.SortFields.Clear() ws.Sort.SortFields.Add(xl.Range("A8:A" + rows), XlSortOn.xlSortOnValues, XlSortOrder.xlAscending, XlSortDataOption.xlSortNormal) |> ignore ws.Sort.SortFields.Add(xl.Range("H8:H" + rows)

Accessing custom task pane is active window - Visual Basic, VSTO

落花浮王杯 提交于 2019-12-19 10:08:08
问题 I'm creating a COM add-in in VSTO for Ppt 2013 and am having a problem referencing the custom task pane in the active window. My code is supposed to make the custom task pane visible for the active window only, however it currently runs for all document windows. My code is: For Each CTP As Microsoft.Office.Tools.CustomTaskPane In Globals.ThisAddIn.CustomTaskPanes If CTP.Window Is Globals.ThisAddIn.Application.ActiveWindow Then CTP.Visible = True End If Next The taskpane is added to each new

VSTO for the Mac?

梦想的初衷 提交于 2019-12-19 09:15:26
问题 I have built a custom Outlook toolbar option using VSTO which logs an email in a database. This works fine in Windows. However, I’ve been asked if we can migrate this to the Mac for Entourage which I think is the Mac version of Outlook. Can a VSTO application be ported to the Mac? Is it possible to build custom toolbar options in Entourage? 回答1: VSTO for Mac...no. This thread is older, but it still applies. 回答2: No. VSTO , .NET or VBA solutions do not support the current version of Office for

Event on “Item Sent” in Outlook

亡梦爱人 提交于 2019-12-19 06:42:15
问题 I'm using ApplicationEvents_11_ItemSendEventHandler (see http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.applicationevents_11_itemsendeventhandler.aspx) to do some processing when an item is sent from Outlook. However, as this event fires on "send", rather than "sent", I'm unable to obtain certain information, such as the sender, sent time etc. Is there an alternative event that fires after the item has actually sent? I've read this blog post; http://easyvsto