ms-office

MailItem.GetInspector.WordEditor returns Nothing

房东的猫 提交于 2021-01-29 05:23:00
问题 I'm composing an email using VB.Net which is opened in Outlook 2013 . I need to the contents to be displayed in its default font which is set by the user. Now i need to get the default font and set to the email. When i tried it returns null at one place. //Code: Private m_valDefaultFontSpec As DefaultFont Sub GetDefaultFontSpec(Optional blnGetReplyFont As Boolean = False) Dim objDoc As Document Dim rng As Range Dim objDummy As MailItem On Error Resume Next ' Create a "dummy" mail object, Set

How can I format text without changing document state in MSWord web add-in API?

我怕爱的太早我们不能终老 提交于 2021-01-29 05:19:03
问题 I'm developing an add-in for MSWord using Microsoft web add-in API. I'd like to underline or highlight some given words, but only in the scope of that session. I don't want to change the document's state. In other words, I don't want to persist the new text formatting when the document is saved. I know how to format text, but the document's state is changed. I have this code at the moment: word_range.font.underline = Word.UnderlineType.wave; I want to achieve a behavior similar to Grammarly

Finding rows with multiple values in the columns

三世轮回 提交于 2021-01-29 02:45:44
问题 I am attempting to find a way to search rows and find out which ones have multiple values in the rows. For example If I have this: 81 IRENE L MOTZ 82 BRITTNEY SUMMERVILLE 83 NICK SIRK 33 120 1,859 86 DOROTHY TARR 32 87 DAVID BRYANT 89 WAYNEDALE VAULT 90 APRIL HOWARD 95 DONA KAHL 96 ASHLEY FISHER 98 TERRI SULESKI 99 SCOTTSVILLE VAULT 104 CHRISTINE WIECHART 564 105 KAYLENE DUNCAN 7 106 LINDA NETHERTON 107 DIANNA MAY 336 108 DIXIE HETTINGER 596 110 JIM MELVIN 26 111 LASHAWNYA BREWER 181 112 LOIS

How to insert image in a existing word document with c#

。_饼干妹妹 提交于 2021-01-28 14:22:45
问题 I am working with word and c# . taking the snap shot with my code and saving it in a particular folder (ex.C:\Temp). now i want to save the image to an existing word document.any kind of help with short code sample is highly appreciated . Will prefer to use Microsoft.Office.Interop.Word ; 回答1: Of course, the Word object model provides the required methods for inserting an image into the document. To add a picture at the cursor location you just need to call the AddPicture method of the

What is the correct way to figure out the version of Office installed?

依然范特西╮ 提交于 2021-01-28 08:36:31
问题 For Office 2010 & later, what is the correct, supported, always right, best, best, best way to determine: What version of Office (Word) is installed? What its bitness is? The registry entries HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WINWORD.EXE and HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe both have the path to the winword.exe file. Do I use that and read the EXE to get the version & bitness? Also, what if those two registry

Access 2016 (64bit) MSO (365) deployed database cannot run with any runtime avaliable

帅比萌擦擦* 提交于 2021-01-28 07:50:22
问题 I've made an application on an MS Access 2016 with 365 subscription and deployed an .accde file. When I try to open that file on another PC with runtime installed (tried with 2016 4288-1001 64bit and 2013 64bit) I get an error saying "Database you are trying to open requires a newer version of Microsoft Access". I know that are some issues related to runtime and 365, but some people said that using runtime 2013 solved their problem (but not mine). Anyone have a solution for this? 回答1: The

Read/get the current value of an object in Project VBA

折月煮酒 提交于 2021-01-28 06:48:53
问题 I'm struggling to save the current value of an object (at least I think it's an object) in MS Project VBA. Here's what I'm trying to do, save the value of my current header text. dim a As String (or Variant/Object?) a = Application.FilePageSetupHeader.Text.Value This obviously doesn't work, but gets the point across. The syntax for this is: expression. FilePageSetupHeader( ** Name, ** Alignment, ** Text** ) with Name and Text being passed as a string. If I get this to work, I'll also be

What is the use of declaring an ErrObject variable if there can only ever exist one error object?

廉价感情. 提交于 2021-01-28 05:09:56
问题 We all know there can only ever be one error object in VBA. While helping a co-worker with error handling and why he shouldn't use On Error Resume Next I had an idea: Store the error object somewhere to later reference back to it. Consider this piece of test code: Sub Test() Dim t As ErrObject On Error Resume Next Err.Raise 1 Set t = Err On Error GoTo 0 Debug.Print t.Number On Error Resume Next Err.Raise 1 Debug.Print t.Number End Sub It will print 0 to the immediate window because On Error

Force excel to refresh command ribbon (for office add-in) after updating manifest XML

℡╲_俬逩灬. 提交于 2021-01-28 04:50:15
问题 I'm sideloading an office add-in using office.js and an XML manifest located on a share drive. This adds a new ribbon to excel with a few custom command icons once the add-in is loaded. However, after editing the manifest.XML file, say I comment out a command icon from the ribbon, I have not figured out how to force a refresh of the excel ribbon to reflect my changes. I've tried reloading the add-in, re-adding it, restarting excel, updating the manifest version when saving, changing the

“This command is not available.” error occurs when trying to execute PasteAndFormat function

孤街醉人 提交于 2021-01-28 04:10:47
问题 I published the VSTO app, where I copy a Range with a formatted text. On most users machines the application works properly while some users have the error "This command is not available." thrown whenever the following piece of code is being excetuded. var sourceDocument = Globals.ThisAddIn.Application.ActiveDocument; sourceDocument.Range().Copy(); Document documentOld = new Document(); documentOld.Range().PasteAndFormat(WdRecoveryType.wdFormatOriginalFormatting); //here the error occurs