Results 1 to 6 of 6

Thread: Word / ActiveDocumemnt error - object required 424 [***Resolved***]

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    Suffolk. UK
    Posts
    162

    Word / ActiveDocumemnt error - object required 424 [***Resolved***]

    Ok, im having problems with the ActiveDocuments in the following code, and its my first time using word, any pointers where im going wrong, im sure its something simple, but just cant get there????

    do i need to declare the ActiveDocument or a DoEvents??

    thanks

    .....

    VB Code:
    1. 'open word
    2.     Dim Obj As Object
    3.     If Obj Is Nothing Then
    4.         Set Obj = CreateObject("Word.Application")
    5.     Else
    6.         Set Obj = GetObject(, "Word.Application")
    7.     End If
    8.    
    9.     Set Worddoc = Obj.Documents.Add
    10.     Obj.Visible = True
    11.    
    12.     'set up table
    13.  
    14. 'error 424 object requred in the following 2 lines
    15.     ActiveDocument.PageSetup.Orientation = wdOrientLandscape
    16.     ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=2, NumColumns:=10
    17.  
    18.     'insert headings
    19.     Obj.Selection.typeText Text:=Text1(0).Text & vbCr
    Last edited by Ping; Aug 27th, 2003 at 05:53 AM.

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