Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unable to replace Comment TEXT
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Oracle
Miscellaneous
Thread ID:
01330700
Message ID:
01332040
Views:
17
>I'm using VFP-9 sp2 with Word 2003 for automation. I have a collection of comments in my document.
>
>In one of the comment, I have text follow by a table. I want to overwrite the entire content of the comment.
>- I tried the FIND method with a empty replacement text
>torange.Find.Execute(toRange.Text,,,,,,,,,[])
>
>- I tried the FIND method with a replacment text
>torange.Find.Execute(toRange.Text,,,,,,,,,lcCodelist+lcEND)
>
>- I tried the FIND method with a replacment text
>toRange.Text = lcCodelist
>
>I always get the following:
>Microsoft Word: Word can't delete a comment in the comment pane. Instead, delete the comment marker from the main document window...
>
>I think because there is a table in that comment, it won't replace it...
>
>Any idea??? anybody

Hi,

You coud try something like:
for each oComment in oWord.Activedocument.comments
  if oComment.Range.TAbles.count >0
     for each oTable in oComment.Range.TAbles
        for each ocell in oTable.Range.cells
              *replace text
        endfor
      endfor

   endif
endfor
Yuri, lets say a want to delete any text in the comment. Is this suppose to work ?
for each oComment in oWord.Activedocument.comments
  oComment.Range.Select()
  oComment.Range.Delete()        
endfor
Luc Nadeau
lnadeau@neova.ca

"the theory, it is when all is known and that nothing works. The practice, it is when all works and that nobody knows why." - Albert Einstein (Nobel of physique 1921)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform