Results 1 to 11 of 11
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word Doc In Form (VB6)

    Using components, it's possible to insert a Word Document within a form.
    I would like to apply the following code to show a document from a specific path.
    <pre>Dim docPath As String
    docPath = "C:MMPDFDocsdocDW.doc"
    Me.WordDoc1 = docPath</pre>

    This doesn't work, i thought it would be quite simple. ??
    Is this possible ??

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word Doc In Form (VB6)

    Does this work?
    <code>
    Me.WordDoc1.CreateEmbed SourceDoc:=docPath
    </code>
    If you want to link instead of embed the document, use CreateLink instead of CreateEmbed.

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Doc In Form (VB6)

    Method or data member not found ?

    I have Word 11 Object library referenced ?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word Doc In Form (VB6)

    What kind of control (component) is WordDoc1? I assumed - apparently incorrectly - that it was an OLE container.

  5. #5
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Doc In Form (VB6)

    !! OLE container !!

    It is now !

    Thanks Hans, got me off to a good start again.

  6. #6
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Doc In Form (VB6)

    CreateLink instead of CreateEmbed

    Hans

    If I'm using many word docs, as opposed to just one, which is the most efficient ?
    I would presume "CreateLink" !

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word Doc In Form (VB6)

    A link may be more efficient, but the main thing to consider is that if you use CreateLink, and if you allow the user to edit the document by double-clicking the OLE control, the changes will be applied to the original document.

  8. #8
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Doc In Form (VB6)

    Hmmmmmmmmmmmm


    Perhaps I may have to stick with my PDF's !!
    I was trying to implement a system for a wider audience.

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word Doc In Form (VB6)

    If you want to provide documents for reading only, PDF is much better.

  10. #10
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Doc In Form (VB6)

    Hans

    I was hoping to provide a system where the user could determine his own content.
    Thats possible with "Office" as opposed to converting to PDF, obviously the more IT literate would'nt have much of a problem, but there's still many people to educate !!

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word Doc In Form (VB6)

    You could use Word docs in an OLE control. If you set the Locked property of the control to True, users shouldn't be able to save changes to documents.

    Added: Oops, OLE controls don't have a Locked property (I was thinking of Access, obviously). Sorry about that.

Posting Permissions

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