Regarding password in WordML

S

Satish Jadhav

Hi,

I'm working on WordML and want to provide security to my Word file (Saved as
..xml).

I used the following :
<w:documentProtection w:edit="read-only" w:enforcement="on"
w:unprotectPassword="4560CA9C" />

Now I get a pop up asking for password. The password in above code is a
Hexadecimal.

I converted the same in Decimal (and Hexadecimal as well) and used, but
still it says incorrect password.

Can any one pls tell me the solution for the same.

Thanks in advance.

ByE
 
S

Satish Jadhav

Tony Jollans said:
The password is encrypted. What exactly do you want to do?

--
Enjoy,
Tony

www.WordArticles.com




Hi Tony,

Thanks for your reply.
I got the solution for query that I had posted.
Actually I wanted to provide password to my file using WML.
We can save any Word file as .XML and see the code behind it (Open .XML with
MS Visual studio).
But it doesn’t work in case we apply password to a .doc file and save it as
..XML.
<w:documentProtection w:edit="read-only" w:enforcement="on"
w:unprotectPassword="4560CA9C" />
I replaced encrypted value “4560CA9C†with 00000000 in above case , and said
unprotect the document . Again there was a option to protect the document.
I said protect and got a popup asking for password, gave the password and
saved it.
This time it saved the document with password provided.
The encrypted value “4560CA9C†is the string (the password that I gave).
This way I got the solution.
Any other ideas pls let me know ……

Regards,
Satish
 
T

Tony Jollans

Sorry you've lost me completely. You say ...
I got the solution for query that I had posted.

and later you say ...
This way I got the solution.

and, finally, ...
Any other ideas pls let me know ……

Do you have a solution, or not? And, if not, can you explain a little more?
Are you creating this file using Word, or in some other way?
 
T

Tony Jollans

Glad you're sorted.

Just as a side note, as you can see, this kind of protection is of limited
value - it was, even before xml, but now it can be easily removed by anyone
with a text editor.
 
S

Satish Jadhav

Tony Jollans said:
Glad you're sorted.

Just as a side note, as you can see, this kind of protection is of limited
value - it was, even before xml, but now it can be easily removed by anyone
with a text editor.

--
Enjoy,
Tony

www.WordArticles.com


Hi Tony ,

I have got some other issue....in WordML itself.

Description :

To auto generate the Table Of Contents (TOC) in WordML I had written a Macro.
This Macro Updates the Table of Contents when the Word file is opened, works
fine.

But I have a next functionality where I have to pass this Word file to
convert into PDF.

Now the problem is, that the TOC (Table Of Contents) is not updated untill
and unless I open the file (because I have written a Macro "AutoOpen" to
update the TOC).

I'm passing this file to Convert in PDF and after the conversion the TOC is
empty in PDF file.

In PDF the Contents are missing.....

Is it possible to show the TOC in PDF after conversion ?

Bye , Take care

Satish
 
T

Tony Jollans

As you obviously know, building a TOC is a function of Word. If you are
manipulating the document file outside of Word - and then printing it
(creating a pdf, whatever) without using Word, then the TOC may well not be
correct. You have, AFAIK, to use Word itself to update the TOC.
 
S

Satish Jadhav

Hi,

That means there is no way we can work on Macros without opening word file .

Word.ApplicationClass oWord = new Word.ApplicationClass();
Word.Documents oDocs = oWord.Documents;
object oFile = "c:\\Session.doc";

Word._Document oDoc = oDocs.Open(ref oFile, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing);


In above code we have to say Word._Document oDoc = oDocs.Open(....)

Now this code is time consuming in case of concurrent users, where multiple
users may be using the system to convert Word into PDF.

Is there a solution where we can execute macros without opening a file even
at the back ground ?

Regards,
Satish
 
T

Tony Jollans

Is there a solution where we can execute macros without opening a file
even
at the back ground ?

No. To run VBA (Visual Basic for *Applications*) you need to have a
containing Application (Word in this case).
 
S

Satish Jadhav

Hi Tony,

Yes there is no way that we can run macros without opening the document in
Word.

Therefore I had to use the third party for getting the desired result.

Using the property : oPrintJob = oPrinter.WordPrintJob;
oPrinter.WordPrintJob.EnableAutoMacros = true;

Now it displays the proper and updated Contents of Table in PDF after
conversion.

Warm Regards,
Satish Jadhav
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top