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,862 other subscribers

Archive for August, 2014

Web requests and NTLM authentication in .NET

Posted by jpluimers on 2014/08/27

Some links on NTLM authentication in .NET that I’m sure that I will going to need sooner or later:

–jeroen

Posted in NTLM, Power User, Windows | Tagged: , | Leave a Comment »

Some notes on Word automation and showing Bookmarks

Posted by jpluimers on 2014/08/27

Though I’ve done this automation in Delphi, this applies to automation from any development platform. In this particular project, the documents used Bookmarks. Those have changed over time, so has the Word support for it.

From Word 2000 until Word you could disable the showing of Bookmarks by setting the ShowBookmarks property to False like this:

<br />ActiveDocument.ActiveWindow.View.ShowBookmarks := False;<br />

Well, when doing this, Office 2013 can throw an error like this:

EOleException: The ShowBookmarks method or property is not available because this command is not available for reading
ErrorCode: 0x800A11FD
Source: Microsoft Word
HelpFile: wdmain11.chm

The full error message does not give any useful search results. But a partial search finds a Word 2013 issue towards the top of the results:

sometimes Words opens the document in Reading layout. Reading layout does not allow all operations in Word 2013.

If a document is protected, and you try to change something you should not, you get an error message like this:

This method or property is not available because the document is a protected document.

Usually, Cindy Meister is very accurate. However this time here code

...ActiveWindow.View = wdPrintView

should have been like

...ActiveWindow.View.Type = wdPrintView

Of course you also have to save/restore this property while you are enabling the ShowBookmarks property.

Read the rest of this entry »

Posted in Delphi, Delphi XE2, Delphi XE3, Delphi XE4, Development, Office, Office 2000, Office 2003, Office 2007, Office 2010, Office 2013, Office Automation, Power User, Software Development, Word | Leave a Comment »

Tracing NTLM (via: 407 Authentication required – no challenge sent – Stack Overflow)

Posted by jpluimers on 2014/08/26

Might need this one day:

I wrote a utility to decode the NTLM blobs that were sent in the IE and HttpWebRequest sessions.When I look at the HttpWebRequest and IE, they both request 56bit and 128bit encryption from the server.

In both IE/HttpWebRequest, they are requesting both 64 & 128bit security. However, for windows 7, 128bit security for NTLM has been made the default, and without that, authentication will fail. As you can see from the server response, the server is only supporting 64bit encryption.

–jeroen

via: c# – 407 Authentication required – no challenge sent – Stack Overflow.

Posted in NTLM, Power User, Windows | Leave a Comment »

net/http/http_network_transaction_spdy2_unittest.cc – chromium/chromium – Git at Google

Posted by jpluimers on 2014/08/26

Interesting: NTLM unit tests for SPDY: net/http/http_network_transaction_spdy2_unittest.cc – chromium/chromium – Git at Google.

Posted in Uncategorized | Leave a Comment »

NTLM authentication: Connect to TFS 2013 Git Repository with LibGit2Sharp (via: Gáspár Nagy on software)

Posted by jpluimers on 2014/08/26

I’m fighting some NTLM issues with a proxy server and this might come in handy one day: Connect to TFS 2013 Git Repository with LibGit2Sharp « Gáspár Nagy on software.

https://github.com/gasparnagy/Sample_NtlmGitTest/

–jeroen

 

Posted in .NET, C#, Development, NTLM, Power User, Software Development, Windows | Leave a Comment »

Some notes on Word automation and protected documents

Posted by jpluimers on 2014/08/26

Though I’ve done this automation in Delphi, this applies to automation from any development platform. In this particular project, I had to update Word documents. That is fine, unless your documents are protected. You can find out if a document is protected by probing the ProtectionType property of a Document object.

If a document is protected, and you try to change something you should not, you get an error message like this:

This method or property is not available because the document is a protected document.

If you have control of the documents or templates involved, then you can take the recommended steps from Document Handling with protected Microsoft Office Word Template:

Microsoft Office Word offers the possibility to enable document protection only to certain sections of a document. So you can place Bookmarks used by Dynamics AX in a section that is kept unprotected and the Form Controls in a section where Document Protection is enabled.

If you don’t, then you have to check for protection, unprotect, do the modifications, then re-protect the document. Read the rest of this entry »

Posted in Delphi, Delphi XE2, Delphi XE3, Delphi XE4, Development, Office, Office 2000, Office 2003, Office 2007, Office 2010, Office 2013, Office Automation, Power User, Software Development, Word | Leave a Comment »

Linux: sudo, su and their options (via: Ask Ubuntu)

Posted by jpluimers on 2014/08/25

Applies to many Linux distros and explains a lot about sudo, su and their parameters: sudo – How to run a command as a user whose login is disabled? – Ask Ubuntu.

Posted in *nix, Linux, Power User, SuSE Linux | Leave a Comment »

Some paper tricks for your digital camera (in my case: Nikon D700/D300, SB-900 and various lenses)

Posted by jpluimers on 2014/08/25

Sometimes cheap paper stuff beats having no tools at all.

Two things you can use with your Nikon:

For semi- or professional white balance, you’d probably use the WhiBal from Michael Tapes (the same guys that created LensAlign).

–jeroen

Posted in Nikon, Photography, Power User | Leave a Comment »

Sudoku Solver v2.0 for the Apple II. (via: This week we solve Sudoku on the 6502)

Posted by jpluimers on 2014/08/22

Nice: Sudoku Solver v2.0 for the Apple II.

–jeroen

via: This week we solve Sudoku on the 6502.

Posted in //e, Apple, Apple ][, Power User | Leave a Comment »

testing HTTPS with openssl « The Sarth Repository

Posted by jpluimers on 2014/08/22

Interesting:

openssl s_client -connect localhost:443

I don’t have a Linux machine here, but this might work too:

gnutls www.somesite

And note that when using telnet, the hostnames must match:

$ openssl s_client -connect XXX.XX.XX.XXX:443
... connection information will be displayed …
GET / HTTP/1.1
host: XXX.XX.XX.XXX

or

$ openssl s_client -connect www.example.com:443
... connection information will be displayed …
GET / HTTP/1.1
host: www.example.com

Don’t MIX

Now I need to research how it works with a proxy… simulate a “connect http/1.1 443” proxy – Google Search.

–jeroen

via:

Posted in OpenSSL, Power User, Security, Windows, Windows-Http-Proxy | Leave a Comment »