ms-office

Get item.recipient with Outlook VBA

和自甴很熟 提交于 2019-12-18 05:20:22
问题 I need to get the recipient email address out of an item on Outlook 2010. My code is as follow: sSQL = "SELECT id from dbo.database where email_address LIKE '" & Item.RecipientEmailAddress & "' item.recipientEmailAddress is not valid, but I need something like that. I know that you have a code call Item.SenderEmailAddress but in this case I need the recipient's email address. I've seen some other threads on that subject but I did not manage to make any of them work. 回答1: For a "quick" way of

Is it necessary for the build machine to have Microsoft Office 2007 installed?

旧时模样 提交于 2019-12-18 04:46:11
问题 Our app added functionality to allow users to import certain information from an excel spreadsheet (all users will have Office 2007 already). The development machine has Office 2007 and the developer added a reference to Microsoft.Office.Interop.Excel - all was good. However, the build machine does not have Office 2007 installed. When the build is run on the build machine, we get the following build error: "The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are

SaveAs vs SaveAs2 in the Microsoft Office Word object model

坚强是说给别人听的谎言 提交于 2019-12-18 04:34:10
问题 It looks like SaveAs has gone away in Office 2010 in favor of SaveAs2. What is going on here? Are there any important differences between the two? My fix has been to check for SaveAs2 first, and then fall back to SaveAs. Is this reasonable? 回答1: It hasn't gone away, you've just got another way to save the document. Save2() takes an extra argument, CompatibilityMode. If you don't care about the compatibility mode then just keep using Save(). If you do then check Application.Version to verify

How does Office 2013 implement black windows for IRM?

旧街凉风 提交于 2019-12-17 20:56:49
问题 I noticed that when I press PrntScrn while an IRM-protected email is open in Outlook 2013, the email's window is replaced with a solid black rectangle when I paste the screenshot into mspaint. I'm not aware of any "Screenshot" window message being sent to windows, so how is this feature implemented? I never see any black pixels on my monitors so I don't think it has a keyboard hook to listen for PrntScrn and then paints the window black. 回答1: Using the WinAPI function SetWindowDisplayAffinity

different format into one single line Interop.word

放肆的年华 提交于 2019-12-17 20:37:54
问题 I've been trying to figure out how to insert 2 different formats into the same paragraph using interop.word in c# like this: hello planet earth here's what I want to do 回答1: Assuming you have your document defined as oDoc, the following code should get you the desired result: Word.Paragraph oPara = oDoc.Content.Paragraphs.Add(ref oMissing); oPara.Range.Text = "hello planet earth here's what I want to do"; object oStart = oPara.Range.Start + 13; object oEnd = oPara.Range.Start + 18; Word.Range

How to disable popups when opening a file using Microsoft.Office.Interop

拈花ヽ惹草 提交于 2019-12-17 18:34:57
问题 Such as read-only confirm, other alerts. What to do with these popups? Or ignore them? 回答1: See my answer here. Basically, you disable all alerts via the "Display Alerts" method: Microsoft.Office.Interop.[OFFICE_APP].Application app = new Microsoft.Office.Interop.[OFFICE_APP].Application(); app.DisplayAlerts = false; where [OFFICE_APP] is the name of the Office program you're using, such as Word, Excel, etc. 回答2: Here is another alternative to prevent the Security message asking you to allow

What browser / browser engine do Office Add-ins use?

你说的曾经没有我的故事 提交于 2019-12-17 16:59:47
问题 So I am trying to get started developing Office 365 Add-ins (previously Apps for Office), and I was wondering what browser or browser engine Office uses when it renders your app. I tried using JavaScript's navigator.appCodeName and navigator.appName , but due to the problem described here renders that method useless. What browser or engine do Office Add-ins use to render apps? 回答1: It depends on where Office is being used. If it's on Windows Desktop, Office Add-ins use an Internet Explorer to

How can I programmatically freeze the top row of an Excel worksheet in Excel 2007 VBA?

 ̄綄美尐妖づ 提交于 2019-12-17 16:30:13
问题 I am looking to programmatically freeze the top row of an Excel worksheet from VBA. The end goal is to produce the same effect as the View > Freeze Panes > Freeze Top Row command in Excel 2007 so that the top row of the worksheet is frozen and users can see the top row of the worksheet even as they scroll through the data. 回答1: Rows("2:2").Select ActiveWindow.FreezePanes = True Select a different range for a different effect, much the same way you would do manually. The "Freeze Top Row"

python convert microsoft office docs to plain text on linux

为君一笑 提交于 2019-12-17 16:28:01
问题 Any recomendations on a method to convert .doc, .ppt, and .xls to plain text on linux using python? Really any method of conversion would be useful. I have already looked at using Open Office but, I would like a solution that does not require having to install Open Office. 回答1: I'd go for the command line-solution (and then use the Python subprocess module to run the tools from Python). Convertors for msword ( catdoc ), excel ( xls2csv ) and ppt ( catppt ) can be found (in source form) here:

RCW & reference counting when using COM interop in C#

↘锁芯ラ 提交于 2019-12-17 15:26:02
问题 I have an application that uses Office interop assemblies. I am aware about the "Runtime Callable Wrapper (RCW)" managed by the runtime. But I am not very sure how the reference count gets incremented. MSDN says, RCW keeps just one reference to the wrapped COM object regardless of the number of managed clients calling it. If I understand it correctly, on the following example, using Microsoft.Office.Interop.Word; static void Foo(Application wrd) { /* .... */ } static void Main(string[] args)