ms-office

Running headers for multiple levels of headings

空扰寡人 提交于 2019-12-13 03:55:52
问题 I know, there is a simple way to create running headers using STYLEREF field. Just put this: { STYLEREF "Heading 1" } in the header of your document, and it works fine. However, the problem arises when I want to match multiple heading levels. For example, on 1st page of my document I have a Heading 1 style with text Foo . And on the 2nd page of document I have Heading 2 style with text Bar . When I'm on 1st page of document, I want to see the "Foo" in the page header. When I'm on the 2nd page

IE automation via Outlook - Permission Denied issues

怎甘沉沦 提交于 2019-12-13 03:54:18
问题 Sub test() Dim objShell As Object Dim objShellWindows As Object Dim objWin As Object Set objShell = CreateObject("Shell.Application") Set objShellWindows = objShell.Windows For Each objWin In objShellWindows If TypeName(objWin.Document) = "HTMLDocument" Then Debug.Print objWin.Document.Location End If Next objWin End Sub This works perfectly fine in Excel, Access, Word and PowerPoint, but throws "Run-Time error 70 - Permission Denied" error on the Debug.Print line when ran from Outlook. I'm

Display HTML page in Office 2003 or 2007 task pane via VBA

☆樱花仙子☆ 提交于 2019-12-13 02:51:55
问题 Is it possible to display an HTML page in an Office 2003 and/or 2007 task pane via VBA? Background: We have a complicated configuration file that our users maintain in Word (using a real editor is not an option for our audience). We would like to create several toolbar buttons that display a basic HTML page in a task pane as a form of online help for our users. The reason we want to use a task pane to display help (vs. an external browser or traditional help engine) is so that the help

Traverse through every possible path in a Visio Flow-Chart with C#

淺唱寂寞╮ 提交于 2019-12-13 02:50:41
问题 I recently started to work with C# and I have to import a Visio file that is including a flow-chart with different path. I load the file with this code. public Container loadFile(string fileName) { Microsoft.Office.Interop.Visio.Application app = new Microsoft.Office.Interop.Visio.Application(); app.Visible = false; Documents docs = app.Documents; Document doc = docs.Open(fileName); Microsoft.Office.Interop.Visio.Page page = doc.Pages[1]; Container container = printProperties(page.Shapes);

Count Read and Unread Emails date wise for shared mailbox

点点圈 提交于 2019-12-13 01:33:35
问题 I have edited VBA which I found in Stack Overflow to suit my needs. It gives me the count of emails of my default inbox date wise and count of unread emails without dates. I need it to count the emails of my shared mailbox. For example Redstreamattmail and not the default mailbox, DATE WISE for overall emails and unread emails. Sub HowManyEmails() Dim objOutlook As Object, objnSpace As Object, objFolder As MAPIFolder Dim EmailCount As Integer Dim a As Outlook.Application Dim b As Outlook

Using the same API to write both Word and PDF documents

天大地大妈咪最大 提交于 2019-12-13 01:04:19
问题 HI all is there any kind of abstraction API over Apache POI/FOP allowing one to use the same API to write both Word and PDF documents ? 回答1: I'm not aware of a unified API for the two libraries you have mentioned. However you may still have a couple of options using a single API: Use Apache POI to generate the documents in Word format and then use a Word to PDF conversion library to create a PDF from the word document. Another commenter has suggested IText Use OpenOffice via its Java API to

Consistently retrieve “From” email addresses across Outlook versions

给你一囗甜甜゛ 提交于 2019-12-13 01:02:35
问题 I am working a standalone c# desktop application that sends out documents and then imports them from Outlook when they are sent back. The application picks up the emails from a specified folder processes them and then saves the senders name plus other stuff to a database. This works well for Outlook 2003 and 2007 which has the SenderEmailAddress property. However Outlook 2000 and XP does not have this property and will not consistently return name@domain.com. I am providing support for these

C# - Hash contents of MS Office documents without metadata

泪湿孤枕 提交于 2019-12-13 00:59:32
问题 I am trying to identify files with duplicate contents. Decided to do a comparison using a hashing mechanism (MD5, SHA1 or any other). Works fine with ".txt" files. However, with MS Office files (.doc,.docx,.xls, etc) this fails. MD5/SHA1 hash is not constant for MS Office files, even if they have the same "text" content. I assume MS Office stores some kind of meta-data in the file, which changes each time you save the file. Thus the hash is different. e.g. I have a file ABC.doc and I compute

Loop through all TableFields in Microsoft Project add to combobox

谁都会走 提交于 2019-12-12 21:48:40
问题 I'm stuck trying to create a UserForm in VBA with a combobox that lists all possible TableFields(?). Updated code: Using the code provided by @dbmitch and some freestyle. This lists a two-column combobox with both the Original and the Custom field name (if it exists). It only lists the fields used in the Activeproject. Not all possible fields. But if the field isn't used in the Activeproject anyway... maybe this is for the best! Public strResult2 As String ' Used for custom field names

Microsoft Access required for C# database access on end-user machines?

江枫思渺然 提交于 2019-12-12 21:19:36
问题 Silly question, perhaps. I've developed an app on my machine that uses a Microsoft Access database (.mdb) to access certain information and populate a table with monitoring data using OLEDb. The application works fine on my machine, but when I put the release on test machines (without MS Access), it crashes. Interestingly, if I were to launch the application on the testing machine with the database filename just renamed, it loads like it should albeit without the data. I seem to get an