SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Feb 2007
    Posts
    57
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Reading a word file by rows and column

    Hi All,

    I have a word doc with some information.
    I want to read the doc based on the Column and Line number of the document.

    I have written a code, but it retrives no values says (There is no table in this location)
    Any pointers, suggestions and comments are highly apprecited


    Code

    ____________________________________________

    Set oWord = CreateObject("Word.Application")

    oWord.Documents.Open "c:\ravi kaser\One.doc"

    Set oDoc = oWord.ActiveDocument

    Set wordRange = oDoc.Paragraphs(1).Range

    msgbox wordRange.Cells(1,1 ).value

    _________________________________________

  2. #2
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Reading a word file by rows and column

    What do you mean by column? Do you have a Table in the word doc?

  3. #3
    Member
    Join Date
    Feb 2007
    Posts
    57
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Reading a word file by rows and column

    Column and Line (row) in the Status bar

  4. #4
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Reading a word file by rows and column

    And what be the used of reading the document character by character? You would land up having a very slow reading code

  5. #5
    Member
    Join Date
    Feb 2007
    Posts
    57
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Reading a word file by rows and column

    Hi Tarun,

    I have an application that generates a text file as a result of an action.

    I need to verify the characters on a specified location (line, column) on this result file.

    The speed in not much of a constrain here.

    Manual testing this document is very tedious and time taking.

  6. #6
    Member
    Join Date
    Mar 2008
    Posts
    54
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Reading a word file by rows and column

    I have faced the same issue with .xml file.

    You can use this below code and meke the changes as your wish.

    Set fso = CreateObject("Scripting.FileSystemObject")
    FileName="E:\Test.xml"
    If fso.FileExists(FileName) Then
    Set var_ReadFromFile = fso.OpenTextFile(FileName, 1, True)
    Do While var_ReadFromFile.AtEndOfStream <> True
    StringRead = var_ReadFromFile.ReadLine
    var_Res = strcomp(StringRead,MatchString)
    If var_Res = 0 Then
    Msgbox "String is found"
    Exit Do
    End If
    Loop
    End If
    var_ReadFromFile.close
    Set fso=Nothing

    You can do some changes and check it.

  7. #7
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Reading a word file by rows and column

    samrit, It won't work as doc files are not plain text file

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 03:53 PM.

Copyright BetaSoft Inc.