Results 1 to 5 of 5

Thread: Word Automation Questions

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Edgerton, WI
    Posts
    381
    From a form in my project I'd like to be able to click a button that would lauch the Envelope & Labels Dialog in Word and past the contents of TextBox3 (The Recipients Name) and TextBox4(The Recipients Address, into the "Delivery Address" portion of the Envelope & Dialog Form n Windows. So far I have had no success. ANy ideas here would be most welcomed.

    On a related matter, when the Envelope & Labels Dialog Form is viewed is there a way that I can for it in the center of my midi-form like a midi-child.

    Thanks,
    Rev. Michael L. BUrns

  2. #2
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Newbury, UK
    Posts
    1,878
    Access to Word:

    Put a reference to Microsoft Word 9.0 Object Library into your project.
    Then this little snippet will provide access into Word:

    Dim Obj
    Dim OrigFullFile, As String
    Set Obj = Word.ActiveDocument
    If Obj.Saved = False Then Obj.Save
    OrigFullFile = Obj.FullName


    Or use something like:
    Set obj = Documents("Report.doc")

    You can then manipulate Obj. E.g.
    Obj.Tables.Add _
    Range:=Selection.Range, NumRows:=2, _
    NumColumns:=4

    I have never done anything with dialogues, but maybe this can help:

    Set dlg = Dialogs(wdDialogFileOpen)
    aButton = dlg.Display
    fSelected = dlg.Name
    If aButton = -1 Then
    Documents.Open FileName:=fSelected
    End If

    For more information about displaying Word dialog boxes, see “Displaying built-in Word dialog boxes” in Help.


    Cheers, Chris

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Edgerton, WI
    Posts
    381
    Chris,

    Thanks for the input. You have given me somewhere to start and much food for thought.

    Pastor Mike

  4. #4
    Lively Member PCreyght's Avatar
    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    98

    Talking Sample

    I got this samplefile for you to test on...

    Its not mine but i used it previously to answer some of my own questions. all credits goes to the original maker
    Attached Files Attached Files

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Edgerton, WI
    Posts
    381
    PCreyght,

    Thanks for the attachment. I'll take a look at it after breakfast. Sure I can leard a great deal from it. have a nice day.

    Pastor Mike

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