Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word OLE object (2003)

    How to add a Word OLE Object control in a form. I mean I would like to have always a Word OLE object in the form to avoid to have to go through the Object Insert process.
    thank you and regards,
    Marcel

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

    Re: Word OLE object (2003)

    I'm not sure what you mean. You could create a dummy form with a Word document object once, and duplicate/import that as needed, or copy the control from the dummy form to another form.

  3. #3
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word OLE object (2003)

    I want to have a form with an OLE object control but instead to have to chose Insert Object and select Word document, I would like to have directly a Word document object when I create a new record with the form.
    Hope this is more clear.
    Regards,
    Marcel

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

    Re: Word OLE object (2003)

    Say that your bound OLE control is named oleWord. You could use the Before Insert event of the form to create the Word object as soon as the user types something in a new record.

    Private Sub Form_BeforeInsert(Cancel As Integer)
    With oleWord
    .Class = "Word.Document.8"
    .Action = acOLECreateEmbed
    End With
    End Sub

  5. #5
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word OLE object (2003)

    Thank you Hans,

    I have just added a Me.txtDate.setfocus at the end of your procedure where txtDate is the first control to have the focus when I create a new record.
    Best regards,
    Marcel

Posting Permissions

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