Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-06-2013, 01:16 PM
PosseJohn PosseJohn is offline Need Help With Opening a Word Document Windows 7 32bit Need Help With Opening a Word Document Office 2010 32bit
Novice
Need Help With Opening a Word Document
 
Join Date: Jul 2011
Posts: 20
PosseJohn is on a distinguished road
Default

MY BAD!!



I had the following code in the Document_Open event which precluded unprotecting the document.

So in fact, macros/VBA is enabled with the document, BUT it still opens as READ-ONLY.

Code:
    If ThisDocument.Name = "U3TO.docm" And ThisDocument.ReadOnly = False Then
        Select Case ThisDocument.ProtectionType
            Case wdAllowOnlyComments
                'This is the protection that the file should find itself in.
                ThisDocument.Unprotect Password:=conPass
            Case wdAllowOnlyFormFields
                MsgBox "Only Form Fields, this SHOULD NOT BE RECEIVED"
                ThisDocument.Unprotect Password:=conPass
            Case wdAllowOnlyReading
                MsgBox "Only Reading, this SHOULD NOT BE RECEIVED"
                ThisDocument.Unprotect Password:=conPass
            Case wdAllowOnlyRevisions
                MsgBox "Only Revisions, this SHOULD NOT BE RECEIVED"
                ThisDocument.Unprotect Password:=conPass
            Case wdNoProtection
                'No action, had to trap no protection in case file was saved unprotected.
        End Select
    End If
I've changed the code to:
Code:
    If ThisDocument.Name = "U3TO.docm" Then
        Select Case ThisDocument.ProtectionType
            Case wdAllowOnlyComments
                'This is the protection that the file should find itself in.
                ThisDocument.Unprotect Password:=conPass
            Case wdAllowOnlyFormFields
                MsgBox "Only Form Fields, this SHOULD NOT BE RECEIVED"
                ThisDocument.Unprotect Password:=conPass
            Case wdAllowOnlyReading
                MsgBox "Only Reading, this SHOULD NOT BE RECEIVED"
                ThisDocument.Unprotect Password:=conPass
            Case wdAllowOnlyRevisions
                MsgBox "Only Revisions, this SHOULD NOT BE RECEIVED"
                ThisDocument.Unprotect Password:=conPass
            Case wdNoProtection
                'No action, had to trap no protection in case file was saved unprotected.
        End Select
    End If
Is there code to change READ-ONLY?
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help With Opening a Word Document Word Document Not Opening With Excel VBA JennEx Word VBA 3 06-20-2013 10:10 AM
Need Help With Opening a Word Document Need help opening my important word document HenrikSandstrom Word 1 12-03-2012 03:52 PM
Need Help With Opening a Word Document Problem opening second Word document bTaryag Word 1 08-02-2011 02:48 PM
Word document not opening 7beats Word 2 04-16-2010 12:40 AM
Opening word document problem SPARKY77 Word 4 11-02-2009 01:34 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:10 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft