none
My.Computer.Filesystem? RRS feed

  • Question

  • I am trying to read text from a .txt file into the vba editor which will be used as a chuck of code. Everything ive found online says to use the My.Computer.Filesystem object to read the text from a specific file. When typing this code into the editor it doesnt recognize it. Is there some setting i have to load first or is there a different way of getting text out of a text file?

    Much appreciated.

    -Chris

    Tuesday, June 28, 2011 5:51 PM

Answers

  • Hi Chris

    FileSystem, if I'm following correctly what you're talking about, isn't available in all versions of Office. Which version are you using?

    Do you have a link to "everything you've found on-line" so that we can see what background information you've been looking at?

    Try searching on the terms: Print # Statement, Write # Statement, Input # Statement, Open Statement

    These are old classic VB things that "everyone" used to use for manipulating text files. If you're working with a version of Office where FileSystem is depracted, then that's what you need.

    Another thought: using FileSystem in some earlier versions of Office required you to set a Reference to a library, that could also be your problem - but without knowing the version of Office involved...


    Cindy Meister, VSTO/Word MVP
    Wednesday, June 29, 2011 9:20 AM
    Moderator

All replies

  • Hi Chris,

    Please post the code that you are using and I'm sure someone will be able to help you.


    Kind Regards, Rich ... http://greatcirclelearning.com
    Tuesday, June 28, 2011 6:05 PM
  • Hi Chris

    FileSystem, if I'm following correctly what you're talking about, isn't available in all versions of Office. Which version are you using?

    Do you have a link to "everything you've found on-line" so that we can see what background information you've been looking at?

    Try searching on the terms: Print # Statement, Write # Statement, Input # Statement, Open Statement

    These are old classic VB things that "everyone" used to use for manipulating text files. If you're working with a version of Office where FileSystem is depracted, then that's what you need.

    Another thought: using FileSystem in some earlier versions of Office required you to set a Reference to a library, that could also be your problem - but without knowing the version of Office involved...


    Cindy Meister, VSTO/Word MVP
    Wednesday, June 29, 2011 9:20 AM
    Moderator