This project has moved. For the latest updates, please go here.

Password Protected Document

Oct 28, 2014 at 2:03 PM
Edited Oct 28, 2014 at 2:05 PM
Hi All

Can anybody help me out with a problem ?

I have a word document that is password protected ? which means that when the document opens up it asks for a password ? So is there by any chance a way to detect if the document is password protected using OfficeToPDF v1.4


This is the error i get

__"Unable to cast COM object of type 'Microsoft.Office.Interop.Word.ApplicationClas
s' to interface type 'Microsoft.Office.Interop.Word._Application'. This operatio
n failed because the QueryInterface call on the COM component for the interface
with IID '{00020970-0000-0000-C000-000000000046}' failed due to the following er
ror: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTR
EGISTERED)).

Unhandled Exception: System.InvalidCastException: Unable to cast COM object of t
ype 'Microsoft.Office.Interop.Word.ApplicationClass' to interface type 'Microsof
t.Office.Interop.Word._Application'. This operation failed because the QueryInte
rface call on the COM component for the interface with IID '{00020970-0000-0000-
C000-000000000046}' failed due to the following error: Library not registered. (
Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCM
D, IntPtr& ppTarget, Boolean& pfNeedsRelease)
at Microsoft.Office.Interop.Word.ApplicationClass.Quit(Object& SaveChanges, O
bject& OriginalFormat, Object& RouteDocument)
at OfficeToPDF.WordConverter.Convert(String inputFile, String outputFile, Has
htable options)
at OfficeToPDF.Program.Main(String[] args)
"______


Thanks

Osama