Results 1 to 6 of 6
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts
    We generate documents(invoices) that are Protected, Forms with a specific password. for formatting purposes a specific print form is called.

    other documents are Protected forms, setup with formfields no password. These documents are setup with a straight toggle on/off for Protect/Unprotect document These docs require regular printing.

    The different tests for protected documents "wdProtectionType" are:
    wsAllowOnlyComments
    wdAllowOnlyFormFields
    wdAllowOnlyRevisions
    wdNoProtection.

    The problems is both these documents return "wdAllowOnlyFormFields", because they are these types of docs. One has a specific password the other protected doc doesnt have a password.

    If I do some fine tuning code - and test by adding the specific password eg
    If specific password = "" then...
    the result is both documents are unlocked

    Anyone else encounter this issue? Is this a limitation of Word and working with protected documents?

    any ideas on how i can display the different forms for the different types of protected documents?


    diana

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You could use a custom document property or a document variable to store the type of document. For example you could create a custom document property named DocType with value either Pw or NoPw. You can then use

    Code:
    If ActiveDocument.CustomDocumentProperties("DocType") = "Pw" Then
      ...
    Else
      ...
    End If

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi Hans

    The protected documents with passwords already have a unique identifier in the form of customDocumentProperty.

    Ive already tested trying to extract customDocumentProperty. The result and problem is when the code runs to check for customDocProperty, because the document is "locked", it doesnt return any customDocumentProperties although they exist.

    diana

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You should still be able to retrieve the value of a custom document property in a document protected for forms. I tested it just now and it works fine.

  5. #5
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK ill continue working on it see how I go.

    Ill let you know

    many thanks Hans

    diana

  6. #6
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hey Hans

    yes acessing CustomDocumentProperties worked on a password protected document

    Many thanks again

    dd

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •