Consulting

Results 1 to 5 of 5

Thread: Read only for older versions of Word

  1. #1

    Read only for older versions of Word

    Hi,

    I have been working in Word 2013, using rich text content controls mapped to custom xmls. Until now I thought that Word 2010 supported that as well, but if I open it in Word 2010 the xml-mapping for the rich text CCs disappears, and when I reopen the file in Word 2013 it says a problem was found with its content.

    Now I want to set conditional read only. I want to force read only if the document is opened with a Word version earlier than 2013.

    Are there any smart ways to implement something like this?

    Best regards,
    David

  2. #2
    So this is not possible I suppose? *bump*

  3. #3
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,337
    Location
    I think that all you can really do if you expect to share these documents with Word 2010 users is a) Use compatibility mode and don't use mapped rich text controls or 2) convert to pdf.
    Greg

    Visit my website: http://gregmaxey.com

  4. #4
    I noticed that if a user opened the document in Word 2010, changed something and then saved it, the document became corrupt, and the mapped rich text content controls disappeared. But if a user didn't change anything the document remained intact. So I solved the issue by a Document.Open event, checking the version and closing the document again if the version was older than 2013.

  5. #5
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,337
    Location
    To be able to share with Word 2010 users perhaps you could do something like this:

    Sub Document_Open()
    Dim bCompatible As Boolean
      On Error Resume Next
      bCompatible = ActiveDocument.Variables("Compatible")
      If Err.Number <> 0 Then
        ActiveDocument.Variables("Compatible") = "False"
        bCompatible = False
      End If
      On Error GoTo 0
      If Application.Version < 15# And ActiveDocument.Variables("Compatible") = "False" Then
        If MsgBox("This document was created in Word 2013 or higher and contains mapped rich text content controls." & vbCr + vbCr _
               & "To view this document in Word 2010 or lower it must be saved as a ..." & vbCr + vbCr _
               & "Do you want to ...", vbQuestion + vbYesNo, "COMPATIBILITY") = vbYes Then
          Dialogs(wdDialogFileSaveAs).Show
          ActiveDocument.Variables("Compatible") = "True"
        Else
          ActiveDocument.Close ""
        End If
      End If
    End Sub
    Greg

    Visit my website: http://gregmaxey.com

Posting Permissions

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