The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,854 other subscribers

Archive for the ‘Office’ Category

Word API Documents collection documentation: moved and changes with the introduction of Word 2013

Posted by jpluimers on 2014/08/05

I’ve done a bit of WinWord automation and came across different locations for the API:

New Style:

Old Style:

Fun fact: there is no Old Style Word 2007 documentation any more. You might expect it at http://msdn.microsoft.com/en-us/library/ms263641(v=office.12) but it is not there.

Not so fun fact (and the reason I was looking for the Documents documentation), is because of this big bug ONLY in Office 2010 (it does not occur in Office 2000 .. 2007, and is fixed in 2013): The WordMeister » Bug Word 2010: Documents collection is not correctly maintained.

The only workaround is to run an Office Add-in, or VBA Macro. Both not feasible for external clients.

–jeroen

Posted in Delphi, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, Office, Office 2007, Office 2010, Office 2013, Office Automation, Office VBA, Power User, Scripting, Software Development, VBScript | Leave a Comment »

Multiple office versions on one computer: it is possible, but you should not do it

Posted by jpluimers on 2014/08/01

Wow, I didn’t even know this was possible, but I recently came across a few people that had actually done this: run multiple versions of Office on one computer.

Microsoft even has a couple of knowledge base articles on it and indicate it is not recommended (wow!), installation/update orders, and potential issues you will face.

I’ve added the respective office version ranges for each link:

–jeroen

Posted in Excel, Office, Office 2003, Office 2007, Office 2010, Office 2013, Outlook, Power Point, Power User, Word | Leave a Comment »

.NET/C#: Interesting DocX library to create OOXML documents for Word

Posted by jpluimers on 2014/07/10

In case I need to export DocX in .NET again: DocX – Home which is also at github.com/WordDocX/DocX

(I did it both with Word Automation and OOXML, they were a pain).

–jeroen

Posted in .NET, .NET 4.0, .NET 4.5, C#, C# 4.0, C# 5.0, Development, Office, Office 2007, Office 2010, Office 2013, Office PIA, Software Development | Leave a Comment »

Excel worksheet function – How do I get the weekday name of a date?

Posted by jpluimers on 2014/07/04

At first sight you’d think that getting the weekday name of a date in Excel is as easy as this simple example using the [Wayback/Archive] WEEKDAY function as an intermediate:

A1 cell: 1/8/2009
B1 cell: =TEXT(WEEKDAY(A1),"dddd")

This will, for the given date, print the corresponding day.

The outcome for the 1st of August 2009 (we do dd/mm/yyyy over here) is Saturday, and you might think it is the right way to do it.

Well, as [Wayback/Archive] AdamV explains in [Wayback/Archive] it is not: the outcome is OK on certain systems, but not OK on other systems.

The actual solution is even simpler, but before we go there, lets first explain what is potentially wrong with the above code:

  • A1 has a date value
  • =WEEKDAY(A1)
    obtains an integer value
    in this case: 7
  • =TEXT(7, "dddd")
    obtains the weekday name of the integer value 7
    in this case: SATURDAY
  • The latter is only because of two things:
    • First the way TEXT operates:
      =TEXT(B1,"dddd, yyyy-mm-dd")
      returns this full date:
      Saturday, 1900-01-07
      Which means that if you don’t fill in a month or year, it uses January of 1900.
    • Second:
      Excel thinks the 1st of January 1900 is a Sunday (actually, it is Monday)
      so for Excel, the 7th of January 1900 is a Saturday.

Excel has a [Wayback/Archive] bug where weekdays before the 1st of March 1900 are wrong (it is the famous 1900 problem, which somewhat is the inverse of the – also famous – [Wayback/Archive] 2000 is not a leap year problem) which won’t get fixed as [Wayback/Archive] Excel wants to stay compatible with Lotus-1-2-3 which also has the bug.

So it is by luck that Excel gets the above way right.

To make sure it is always right, just format your date as "dddd" as AdamV suggests:

=TEXT(A1,"dddd")

This is much shorter than the first example, and always works well.

--jeroen

PS – via: worksheet function – How do I get the day name into a cell in Excel? – Super User.

Posted in Excel, Office, Power User | Leave a Comment »

A few Excel printing tips I always forget

Posted by jpluimers on 2014/05/30

With most software, most of the time you don’t use the majority of the features.

So when you need a part of that majority, it is always hard to find.

For Excel, most of my printing is standard (if I print at all), so these two are particularly hard to remember:

–jeroen

Posted in Excel, Office, Office 2007, Office 2010, Office 2013, Power User | Leave a Comment »

Move Around in paragraphs – Microsoft Word keyboard shortcuts

Posted by jpluimers on 2014/05/26

Boy, wish I had known these two Word keyboard shortcuts a long time ago:

  • Ctrl + Up: Go To the start of the previous paragraph
  • Ctrl + Down: Go To the start of the next paragraph

–jeroen

via: Move Around – Microsoft Word.

Posted in Keyboards and Keyboard Shortcuts, Office, Office 2003, Office 2007, Office 2010, Office 2013, Power User, Word | Leave a Comment »

How to force Outlook to use a given proofing language all the time (via: spell check – Super User)

Posted by jpluimers on 2014/04/11

Seems this works so far: spell check – How do I force Outlook to use a given proofing language all the time? – Super User.

Posted in Office, Office 2010, Power User | Leave a Comment »

Computer History Museum Makes Historic MS-DOS 1.1+.20 and Word for Windows 1.1a Source Code Available to the Public (via: Computer History Museum | Press)

Posted by jpluimers on 2014/03/25

Cool: now for download at the Computer History museum:

  • We are today releasing the source code of MS-DOS version 1.1 from 1982, and of version 2.0 from 1983.
  • We are today revealing the technical magic by releasing the source code to version 1.1a of Word for Windows.

–jeroen

via: Computer History Museum | Press | Computer History Museum Makes Historic MS-DOS and Word for Windows Source Code Available to the Public.

Posted in Development, Office, Power User, Software Development, Windows, Word | Leave a Comment »

Word 2007/2010/2013: Enabling the Word Developer Tab on the ribbon (via: Andrew Coates ::: MSFT – Site Home – MSDN Blogs)

Posted by jpluimers on 2014/01/16

This is one of the things I tend to forget, as you do it once per machine, and the place to do it is not logical to me.

I mainly use it to quickly record a Macro (boy, I wish Office had a TemporaryMacro feature like Visual Studio had. Alas no more: Macro Recording/Playback has been removed in Visual Studio 2012).

The logical place for me would be to have a context-menu on the ribbon where you can enable the Developer tab.

Anyway, this is how to enable the Developer tab in Word 2007/2010/2013: Read the rest of this entry »

Posted in Development, Office, Office 2007, Office 2010, Office 2013, Power User, Software Development, Visual Studio 11, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools, Word | Leave a Comment »

How to Open MDI (Microsoft Document Imaging) Formatted files with Office 2007 (via: My Digital Life)

Posted by jpluimers on 2013/12/31

One particular weakness of Microsoft is maintaining support for document formats they have come up with the past.

MDI is one of such formats, and I had quite some old scans and document exports (back when TIFF wasn’t common place, and Microsoft was advertising MDI as a “portable” way of sharing digital print similar to PDF that wasn’t commonplace either).

I’ve exported it to PDF now.

So here is to get it working in Office 2007; it probably works the same in Office 2010 and 2012:

  • installing Microsoft Document Imaging Writer and its corresponding support for the file format.
  • Go to Control Panel, select “Uninstall a program” link under Programs section.”
  • High Microsoft Office 2007 (it may show Ultimate, Enterprise, Professional, Small Business, Home and Student, etc).
  • Click on “Change” located on the navigation link near the top of the window.
  • Select “Add or Remove Features”, then click “Continue”.
  • Expand “Office Tools” section.
  • Click on the drop down list for “Microsoft Office Document Imaging” and select “Run all from My Computer”.
  • Click “Continue”.
  • Click “Close” when installation done.
  • A new virtual printer “Microsoft Office Document Imaging Writer” is created and allows you to print to MDI format (a TIFF variant). And from now onwards you should be able to open any MDI files by simply double click on them. If you still can’t, try to restart your computer.

–jeroen

via: How to Open MDI (Microsoft Document Imaging) Format with Office 2007 « My Digital Life.

Posted in Office, Office 2003, Office 2007, Power User | Leave a Comment »