[Migrated content. Thread originally posted on 08 December 2005]
I am trying to get the text from within a Word document via ActiveX control to allow me to print this. I select the contents of the document and then inquire the text property. The problem is that the text that I get stops at the first single quote (') or double quote (").
The code is:
*Select the current document.
MODIFY wrdDoc @Select()
*Get the current selection of the document.
INQUIRE wrdApp Selection IN wrdSelection
* Put text in buffer for printing on Linux
initialize ws-letter-buffer
inquire wrdSelection @Text in ws-letter-buffer
2 questions - am I doing the right thing and if so how do I get all the data in the letter
First, can you post an example of the text you have selected in MS Word, you mentioned it stops at the first quote or single quote. I would like to see an example.
Is this happening with MS Word 97 only (I don't have that) or does it reproduce with other versions?
[Migrated content. Thread originally posted on 08 December 2005]
I am trying to get the text from within a Word document via ActiveX control to allow me to print this. I select the contents of the document and then inquire the text property. The problem is that the text that I get stops at the first single quote (') or double quote (").
The code is:
*Select the current document.
MODIFY wrdDoc @Select()
*Get the current selection of the document.
INQUIRE wrdApp Selection IN wrdSelection
* Put text in buffer for printing on Linux
initialize ws-letter-buffer
inquire wrdSelection @Text in ws-letter-buffer
2 questions - am I doing the right thing and if so how do I get all the data in the letter
Here is an example of the text:
Client: ?Client_Name? Account Number: ?Client_Reference?
We write to you in connection with the outstanding debt to our Client?s in the sum of ?Current_Balance?. As this has been outstanding for some time now it is imperative that you make substantial efforts to repay this sum within the next 14 days.
If you do not respond to this letter, we will be left with no alternative but to instigate court proceedings, which will increase your indebtedness, by the addition of Court Fees, Solicitor?s Costs and Statutory interest.
We look forward to hearing from you in the next 14 days
Yours sincerely,
It stops after the "'" in Client's.
Added info, there appears to be a number of nulls after the data. I have noticed that this appears in the print files (visible with vim) but is not always the same length for different circumstances. i.e. in the above example I get 91 nulls after "Client" in another I get 122 nulls after ".......... .." (a load of dots followed by a space!)
If I remove the first single quote it works up the second one in the file (Solicitor's Costs
I only have Word 97 so I cannot comment on other versions.
[Migrated content. Thread originally posted on 08 December 2005]
I am trying to get the text from within a Word document via ActiveX control to allow me to print this. I select the contents of the document and then inquire the text property. The problem is that the text that I get stops at the first single quote (') or double quote (").
The code is:
*Select the current document.
MODIFY wrdDoc @Select()
*Get the current selection of the document.
INQUIRE wrdApp Selection IN wrdSelection
* Put text in buffer for printing on Linux
initialize ws-letter-buffer
inquire wrdSelection @Text in ws-letter-buffer
2 questions - am I doing the right thing and if so how do I get all the data in the letter
The NULLs are correct, they should be there.
What version of ACUCOBOL-GT is this?
Can you reproduce this with a small program?
[Migrated content. Thread originally posted on 08 December 2005]
I am trying to get the text from within a Word document via ActiveX control to allow me to print this. I select the contents of the document and then inquire the text property. The problem is that the text that I get stops at the first single quote (') or double quote (").
The code is:
*Select the current document.
MODIFY wrdDoc @Select()
*Get the current selection of the document.
INQUIRE wrdApp Selection IN wrdSelection
* Put text in buffer for printing on Linux
initialize ws-letter-buffer
inquire wrdSelection @Text in ws-letter-buffer
2 questions - am I doing the right thing and if so how do I get all the data in the letter
The NULLs are correct, they should be there.
What version of ACUCOBOL-GT is this?
Can you reproduce this with a small program?
[Migrated content. Thread originally posted on 08 December 2005]
I am trying to get the text from within a Word document via ActiveX control to allow me to print this. I select the contents of the document and then inquire the text property. The problem is that the text that I get stops at the first single quote (') or double quote (").
The code is:
*Select the current document.
MODIFY wrdDoc @Select()
*Get the current selection of the document.
INQUIRE wrdApp Selection IN wrdSelection
* Put text in buffer for printing on Linux
initialize ws-letter-buffer
inquire wrdSelection @Text in ws-letter-buffer
2 questions - am I doing the right thing and if so how do I get all the data in the letter
Attached is a small program which exhibits the fault - wordtest.cbl, hope this helps.
Regards
Nick Brook
CCS - Lancashire
[Migrated content. Thread originally posted on 08 December 2005]
I am trying to get the text from within a Word document via ActiveX control to allow me to print this. I select the contents of the document and then inquire the text property. The problem is that the text that I get stops at the first single quote (') or double quote (").
The code is:
*Select the current document.
MODIFY wrdDoc @Select()
*Get the current selection of the document.
INQUIRE wrdApp Selection IN wrdSelection
* Put text in buffer for printing on Linux
initialize ws-letter-buffer
inquire wrdSelection @Text in ws-letter-buffer
2 questions - am I doing the right thing and if so how do I get all the data in the letter
Sorry forgot the version - 7.0.0.
[Migrated content. Thread originally posted on 08 December 2005]
I am trying to get the text from within a Word document via ActiveX control to allow me to print this. I select the contents of the document and then inquire the text property. The problem is that the text that I get stops at the first single quote (') or double quote (").
The code is:
*Select the current document.
MODIFY wrdDoc @Select()
*Get the current selection of the document.
INQUIRE wrdApp Selection IN wrdSelection
* Put text in buffer for printing on Linux
initialize ws-letter-buffer
inquire wrdSelection @Text in ws-letter-buffer
2 questions - am I doing the right thing and if so how do I get all the data in the letter
Works like a champ for me. I suspect there at three possible reasons for this:
a) There is some control code in the document that can inhibit access to the text, but we cannot see it. I think you can enable show control codes in Word, can you try this?
b) It might be that the ' symbol has a special meaning in your locale, can you check in Control Panel | Regional and language options | Regional Options, click Customize and see that there is no use of this symbol. This can also be checked by for the time being try to change that part of the text that fails to something harmless to see if it makes a difference. Btw which setting do you have?
c) Which actually may be the most likely, it is perhaps a bug in Word97.
I presume you have tried that code you posted on your own system? E.g. this particular program and not only that which is the part of your full application?
When I tested this, I copied the text from your post here via the clipboard into a new document c:\\test.doc, can you do this as well, just to check if there might be something wrong with your document.
When you execute the selection statement, I presume you can see that all the text gets highlighted?
[Migrated content. Thread originally posted on 08 December 2005]
I am trying to get the text from within a Word document via ActiveX control to allow me to print this. I select the contents of the document and then inquire the text property. The problem is that the text that I get stops at the first single quote (') or double quote (").
The code is:
*Select the current document.
MODIFY wrdDoc @Select()
*Get the current selection of the document.
INQUIRE wrdApp Selection IN wrdSelection
* Put text in buffer for printing on Linux
initialize ws-letter-buffer
inquire wrdSelection @Text in ws-letter-buffer
2 questions - am I doing the right thing and if so how do I get all the data in the letter
Works like a champ for me. I suspect there at three possible reasons for this:
a) There is some control code in the document that can inhibit access to the text, but we cannot see it. I think you can enable show control codes in Word, can you try this?
b) It might be that the ' symbol has a special meaning in your locale, can you check in Control Panel | Regional and language options | Regional Options, click Customize and see that there is no use of this symbol. This can also be checked by for the time being try to change that part of the text that fails to something harmless to see if it makes a difference. Btw which setting do you have?
c) Which actually may be the most likely, it is perhaps a bug in Word97.
I presume you have tried that code you posted on your own system? E.g. this particular program and not only that which is the part of your full application?
When I tested this, I copied the text from your post here via the clipboard into a new document c:\\test.doc, can you do this as well, just to check if there might be something wrong with your document.
When you execute the selection statement, I presume you can see that all the text gets highlighted?
[Migrated content. Thread originally posted on 08 December 2005]
I am trying to get the text from within a Word document via ActiveX control to allow me to print this. I select the contents of the document and then inquire the text property. The problem is that the text that I get stops at the first single quote (') or double quote (").
The code is:
*Select the current document.
MODIFY wrdDoc @Select()
*Get the current selection of the document.
INQUIRE wrdApp Selection IN wrdSelection
* Put text in buffer for printing on Linux
initialize ws-letter-buffer
inquire wrdSelection @Text in ws-letter-buffer
2 questions - am I doing the right thing and if so how do I get all the data in the letter
a) Set the options to view everything and there's nothing around the offending characters
b) I Have checked the Regional settings, only the usual comma and decimal point and colon, no single quotes, double quotes or the sequence "..... .. .." which stops after the first group of dots
c) My money's on this one, a bug in Word 97. Are you using Word 97 or a later version?
I did try the code I sent you before I sent it. I have also copied and pasted the data from my previous post into a test document and the results are identical.
The selection statement does in fact highlight all the text.
Weird one huh?
FYI we have decided to produce this program in a different way now and actually print the text of the letter out from Word. It has therefore dropped down the priority list, but is still something we would like an answer for possible future use.
[Migrated content. Thread originally posted on 08 December 2005]
I am trying to get the text from within a Word document via ActiveX control to allow me to print this. I select the contents of the document and then inquire the text property. The problem is that the text that I get stops at the first single quote (') or double quote (").
The code is:
*Select the current document.
MODIFY wrdDoc @Select()
*Get the current selection of the document.
INQUIRE wrdApp Selection IN wrdSelection
* Put text in buffer for printing on Linux
initialize ws-letter-buffer
inquire wrdSelection @Text in ws-letter-buffer
2 questions - am I doing the right thing and if so how do I get all the data in the letter
I am using Word 2003.
Just for the fun of it.
After this line:
INQUIRE wrdApp Selection IN wrdSelection.
[\\code]
Can you add this:
MODIFY wrdSelection Copy().
[\\code]
Then go somewhere else, for instance notepad and paste, see if you get the same result.
[Migrated content. Thread originally posted on 08 December 2005]
I am trying to get the text from within a Word document via ActiveX control to allow me to print this. I select the contents of the document and then inquire the text property. The problem is that the text that I get stops at the first single quote (') or double quote (").
The code is:
*Select the current document.
MODIFY wrdDoc @Select()
*Get the current selection of the document.
INQUIRE wrdApp Selection IN wrdSelection
* Put text in buffer for printing on Linux
initialize ws-letter-buffer
inquire wrdSelection @Text in ws-letter-buffer
2 questions - am I doing the right thing and if so how do I get all the data in the letter
Who's a clever boy then? The copy (and paste in notepad) picked up ALL the text.
I'm not sure what this tells us, the smart money seems to be on a Word 97 bug.
Do I just put this down to experience then and move onward and upward?
Regards
Nick Brook
[Migrated content. Thread originally posted on 08 December 2005]
I am trying to get the text from within a Word document via ActiveX control to allow me to print this. I select the contents of the document and then inquire the text property. The problem is that the text that I get stops at the first single quote (') or double quote (").
The code is:
*Select the current document.
MODIFY wrdDoc @Select()
*Get the current selection of the document.
INQUIRE wrdApp Selection IN wrdSelection
* Put text in buffer for printing on Linux
initialize ws-letter-buffer
inquire wrdSelection @Text in ws-letter-buffer
2 questions - am I doing the right thing and if so how do I get all the data in the letter
Who's a clever boy then? The copy (and paste in notepad) picked up ALL the text.
I'm not sure what this tells us, the smart money seems to be on a Word 97 bug.
Do I just put this down to experience then and move onward and upward?
Regards
Nick Brook
[Migrated content. Thread originally posted on 08 December 2005]
I am trying to get the text from within a Word document via ActiveX control to allow me to print this. I select the contents of the document and then inquire the text property. The problem is that the text that I get stops at the first single quote (') or double quote (").
The code is:
*Select the current document.
MODIFY wrdDoc @Select()
*Get the current selection of the document.
INQUIRE wrdApp Selection IN wrdSelection
* Put text in buffer for printing on Linux
initialize ws-letter-buffer
inquire wrdSelection @Text in ws-letter-buffer
2 questions - am I doing the right thing and if so how do I get all the data in the letter
Hm...
Difficult to tell. When I cannot reproduce it, nor can I suggest anything more.
One Q though, the defintion file you are using, is that one generated on your own computer? If not, can you try to regenerate it with axdefgen and see if that makes a difference?
[Migrated content. Thread originally posted on 08 December 2005]
I am trying to get the text from within a Word document via ActiveX control to allow me to print this. I select the contents of the document and then inquire the text property. The problem is that the text that I get stops at the first single quote (') or double quote (").
The code is:
*Select the current document.
MODIFY wrdDoc @Select()
*Get the current selection of the document.
INQUIRE wrdApp Selection IN wrdSelection
* Put text in buffer for printing on Linux
initialize ws-letter-buffer
inquire wrdSelection @Text in ws-letter-buffer
2 questions - am I doing the right thing and if so how do I get all the data in the letter
Nice thought, that's where I started when I got a "member not found". Re-genned using axdefgen and all was well.
Will this definition work with later versions or will I have to have different programs for each version of Word that my users may have?
[Migrated content. Thread originally posted on 08 December 2005]
I am trying to get the text from within a Word document via ActiveX control to allow me to print this. I select the contents of the document and then inquire the text property. The problem is that the text that I get stops at the first single quote (') or double quote (").
The code is:
*Select the current document.
MODIFY wrdDoc @Select()
*Get the current selection of the document.
INQUIRE wrdApp Selection IN wrdSelection
* Put text in buffer for printing on Linux
initialize ws-letter-buffer
inquire wrdSelection @Text in ws-letter-buffer
2 questions - am I doing the right thing and if so how do I get all the data in the letter
Microsoft is usually very good on backward compatibilty, so I would expect that the def file should be good yes. In fact, I cannot remember having heard of any issues with old def files, only newer used on old binaries.
[Migrated content. Thread originally posted on 08 December 2005]
I am trying to get the text from within a Word document via ActiveX control to allow me to print this. I select the contents of the document and then inquire the text property. The problem is that the text that I get stops at the first single quote (') or double quote (").
The code is:
*Select the current document.
MODIFY wrdDoc @Select()
*Get the current selection of the document.
INQUIRE wrdApp Selection IN wrdSelection
* Put text in buffer for printing on Linux
initialize ws-letter-buffer
inquire wrdSelection @Text in ws-letter-buffer
2 questions - am I doing the right thing and if so how do I get all the data in the letter
Microsoft is usually very good on backward compatibilty, so I would expect that the def file should be good yes. In fact, I cannot remember having heard of any issues with old def files, only newer used on old binaries.