PDA

View Full Version : Problem selecting text from Word



johnsmith
09-27-2012, 07:39 AM
Hi,
I am an Oracle programmer stuck with a Word problem trying to seek some help or explanation in this.
My Knowledge of VBA is next to nothing.

The probelm is that I am trying to select text from a word document and return it to an Oracle Forms using PL\SQL language. I am using built in Oracle Forms functionality which works.

I am trying to returning the text from attached document but it fails at



FUTURE PLAN

{{Patient discharged to GP.||DISPLAY||~<<Discharge patient to GP>>~ =~Yes~}}{{
<<Reason for discharging the patient>>||DISPLAY||~<<Reason for discharging the patient>>~ != ~ ~}}{{
<<Future screening>>||DISPLAY||~<<Future screening>>~ != ~ ~}}{{
Type of Follow up: ||DISPLAY||replace(~<<Type of Follow up>>~,~ ~)is not null}}{{<<Type of Follow up>>||DISPLAY||replace(~<<Type of Follow up>>~,~ ~)is not null}}{{

Interval to next hospital visit: ||DISPLAY||replace(~<<Interval to next hospital visit>>~,~ ~) is not null}}{{<<Interval to next hospital visit>>||DISPLAY||replace(~<<Interval to next hospital visit>>~,~ ~) is not null}}

Reason for prolonged review: <<Reason for prolonged colposcopy review>>


I have used Range and Text as well as Selection,WholeStory,Copy and Text.
Both methods crash after the FUTURE PLAN heading.

The error I get is 5903 The variable name already exists.

If I copy and paste the problematic text into a new document, I don't get any error.
If I delete the problematic text from the document, then the error goes away too.


Please could anyone suggest possible cause of the problem. It can potentially delay an important Go Live.

Thanks

macropod
09-28-2012, 12:33 AM
Without seeing the vba code that's giving problems, diagnosis is a big ask ...

johnsmith
09-28-2012, 06:58 AM
Hi,
I have attached the document which is causing the problem.
The code which is trying to retrieve the text is in PL\SQL.

If you could give me an example of how to select text from the first character to the last, then I shall try to convert it PL\SQL. I need to know the class, method or property etc to use and I shall try to implement them in PL\SQL.

Thanks

macropod
09-28-2012, 08:41 PM
There is no document attached to your latest post and the one attached to your previous post has no vba code. If you're looking for help with errant vba code, then you really do need to provide that. The error indicates that you're trying to create a variable that already exists. Some simple error-checking is enough to prevent such errors, though a re-structuring of the code might be more appropriate.