Results 1 to 9 of 9

Thread: Using Word 2000 in VB 6 [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    Chicago, IL
    Posts
    102

    Using Word 2000 in VB 6 [RESOLVED]

    I have a form that will be used to open an existing Word document. I have that functionality working... sort of. Here's the code snippet...

    'Using Reference to Microsoft Word 9.0 Object Library

    Dim oleWordApp As Word.Application
    Dim oleWordPath As Word.Document

    Private Sub cmdOpen_Click()
    Set oleWordApp = CreateObject("Word.Application")
    Set oleWordPath = oleWordApp.Documents.Open("\\cody\safety procedures\SECTION 01 SAFETY AND LOSS PREVENTION PROGRAM REV. B.DOC")
    End Sub

    Private Sub Form_Unload(Cancel As Integer)
    frmMain.Show
    Set oleWordApp = Nothing
    Set oleWordPath = Nothing
    End Sub

    This opens the document, but not before requiring notification or opening as Read-Only. I'm sure that can be taken care of in the other options that are part of the Open function. A couple of questions:

    1) What are the acceptable values to give for the other options in the Open function? (ConfirmConversions, ReadOnly, AddtoRecentFiles, PasswordDocument, PasswordTemplate, Revert, WritePasswordDocument, WritePasswordTemplate, Format, Encoding, and Visible) I tried VBYes and VBNo, but it didn't like that.

    2) What values are returned when the user presses Notify, ReadOnly, or Cancel? I need to be able to handle the doc if the user presses Cancel. This question can be negated if I can get the above working.

    Thanks in advance!
    Last edited by Daywalker46410; Aug 26th, 2003 at 05:15 PM.
    Joe Cody
    Data Integration Engineer
    Novaspect, Inc.
    Elk Grove Village, IL

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