Results 1 to 3 of 3

Thread: Opening a word document

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Location
    Toronto
    Posts
    10

    Unhappy

    I have a little problem opening a word document on a LAN drive. The code I am using works fine if I am using one of my local drives but gives me this error when I switch to the LAN ("ActiveX component can't create object")

    Here is the code:

    'Documents.Open (SearchDirectory & "\" & File)'

    Searchdirectory is the path and file
    is the filename to be opened.


    Does anyone have any idea why this wont work on a lan? or what to do to fix it?

    By the way....I am using NT

    Any help would be greatly appreciated..

    Thanks

  2. #2
    Addicted Member
    Join Date
    Apr 1999
    Location
    Atlanta
    Posts
    145
    I am doing this in Windows 2000:
    FileName = "h:\IrpInvoices\" & vInvFileName 'Production

    Set objectWord = New Word.Application
    objectWord.Documents.Open (FileName), , , , , , , , , Format:=wdOpenFormatText
    This is working and in production. I guess you made sure your search directory is returning the correct path.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Location
    Toronto
    Posts
    10

    Thanks..

    Thank you very much!!!

    I had already tried declaring it as an object but I didnt use the 'Format:=wdOpenFormatText'.

    It seems that was they key...


    Thanks again

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