Results 1 to 2 of 2

Thread: Please Please Help!!! Problem with Word Object

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    3

    Angry

    Hi all,

    I am trying to write a code that checks if opened document is readonly or not. Below is the code that I used:


    Dim objWord As Word.Application

    Set objWord = New Word.Application

    If objWord.Documents("filename").ReadOnly Then
    'document is readonly'
    Else
    'document is not readonly'
    End If


    It seems like object does not recognize the open document.
    However, if I use same method for Powerpoint presentation, code works perfectly fine.

    Does anyone have idea why above code does not work?

    Thank you very much for your time.

    Charles

    *Microsoft Word object library is properly referenced.

  2. #2
    Addicted Member
    Join Date
    Jan 2000
    Location
    Fresno, California, USA
    Posts
    195
    This property is only available to open documents. So to see it, you need to open the document first:


    objWord.Documents.Open ("Path and File")
    If objWord.ActiveDocument.ReadOnly Then ...

Posting Permissions

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



Click Here to Expand Forum to Full Width