Selecting a range of text in VB
I'm looking for the VB equivalent of this AppleScript:
select text from character x to character y of parentStory (where parentStory is the parent story of the current insertion point)
I get the idea from looking at snippets here and there that VB does this by using a loop, so I've gotten as far as
myWindow.Select parentStory.Paragraphs.Item(1), true
which works well enough, but when I add this line:
myWindow.Select parentStory.Paragraphs.Item(2), true
Paragraph 1 gets deselected. So obviously I'm missing something about the true/false parameter.
I know this is a newbie sort of question, but I've done enough AppleScripting to get the point that it's not necessary to select something before acting upon it. In this case, I need to show it to the user.
Hi Robert,
I have to correct myself. I see now that itembyrange IS part of the VB dictionary in ID2.0, it's just listed under Objects not Texts, where I was looking.
But when I run your code, I get a runtime error: Object doesn't support this property or method. So I've probably fouled something up in the way I'm defining myWindow or parentStory. I will continue banging my head on this wall until something softens.
Try to delete last .Item(1):
myWindow.Select parentStory.Texts.ItemByRange( _
parentStory.Paragraphs.Item(1), _
parentStory.Paragr aphs.Item(2))
Later I'll try to check right syntax for ID 2.0.x.
robin
www.adobescripts.co.uk
Similar Messages
-
Selecting particular range of style using script
HI All,
Can anyone suggest me that how we can select the range of text using script.
I am having some different para styles say for eg., PS1, PS2, PS3, PS4...........
I may applyed these styles in some jumping order but except PS1, now I want to select paragraphs with applied style PS1 to stop before the next appearence of PS1 style.
Like: In a document Para 1, 10, 14, 25 were applied with PS1, so the selection should go in the way like 1-9, 10-13, 14-24 and so on
Regards,
love_all"The" index of a paragraph is nothing special, it's the index of the first character of that paragraph inside its parent story. In particular, it does NOT tell you "this is the 5th paragraph" or something like that.
This is because "Paragraph" is an artificial construct inside "Text", not a truly existing first class object. Same as "Line", "Word", "Character", and indeed, any text selection at all.
Since you already have a "found text" array, "the index" of the nth entry's paragraph -- with the constraint described above -- can be simply found by using foundText[n].paragraphs[0].index (the index of the first character of your foundText is foundText[n].index).
If you DO need to know the nth number of the paragraph, search this forum. I think Peter Kahrel answered to a post to answer that exact question. -
Devloped an ALV report for daily cash receipts for selected date range
hi,
how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report.Hi,
You can develop simple reports using Report Painter.
You may be also interested in:
Check report SAPMF05A for credit memo
See the following Std reports on Payment Advices execute the Tcodes:
S_ALR_87009888
S_ALR_87009889
S_ALR_87009890
S_ALR_87009891
S_ALR_87009892
S_ALR_87009893
S_ALR_87009978
S_ALR_87009979
S_ALR_87009980
S_ALR_87009981
S_ALR_87009982
S_ALR_87009983
S_ALR_87010056
S_ALR_87010057
S_ALR_87010058
S_ALR_87010059
S_ALR_87010060
S_ALR_87010061
S_ALR_87010066
S_ALR_87010067
S_ALR_87012106
S_ALR_87012107
S_ALR_87012108
S_ALR_87012109
S_ALR_87012110
S_ALR_87012111
S_ALR_87012116
S_ALR_87012117
S_ALR_87012200
S_ALR_87012201
S_ALR_87012202
S_ALR_870122
S_ALR_87012204
S_ALR_87012205
S_ALR_87012350
S_ALR_87012351
S_ALR_87012352
S_ALR_87012353
S_ALR_87012354
S_ALR_87012355
sample ALV report:
tables:
marav. "Table MARA and table MAKT
Data to be displayed in ALV
Using the following syntax, REUSE_ALV_FIELDCATALOG_MERGE can auto-
matically determine the fieldstructure from this source program
Data:
begin of imat occurs 100,
matnr like marav-matnr, "Material number
maktx like marav-maktx, "Material short text
matkl like marav-matkl, "Material group (so you can test to make
" intermediate sums)
ntgew like marav-ntgew, "Net weight, numeric field (so you can test to
"make sums)
gewei like marav-gewei, "weight unit (just to be complete)
end of imat.
Other data needed
field to store report name
data i_repid like sy-repid.
field to check table length
data i_lines like sy-tabix.
Data for ALV display
TYPE-POOLS: SLIS.
data int_fcat type SLIS_T_FIELDCAT_ALV.
select-options:
s_matnr for marav-matnr matchcode object MAT1.
start-of-selection.
read data into table imat
select * from marav
into corresponding fields of table imat
where
matnr in s_matnr.
end-of-selection.
Now, we start with ALV
To use ALV, we need a DDIC-structure or a thing called Fieldcatalogue.
The fieldcatalouge can be generated by FUNCTION
'REUSE_ALV_FIELDCATALOG_MERGE' from an internal table from any
report source, including this report.
The only problem one might have is that the report and table names
need to be in capital letters. (I had it )
Store report name
i_repid = sy-repid.
Create Fieldcatalogue from internal table
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = sy-repid
I_INTERNAL_TABNAME = 'IMAT' "capital letters!
I_INCLNAME = sy-repid
CHANGING
CT_FIELDCAT = int_fcat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = i_repid
I_STRUCTURE_NAME = 'marav'
I_DEFAULT = 'X'
I_SAVE = 'A'
TABLES
T_OUTTAB = imat.
IF SY-SUBRC <> 0.
WRITE: 'SY-SUBRC: ', SY-SUBRC .
ENDIF.
Hope this will help.
Regards,
Naveen. -
Select- Color Range- Results in Blue Screen (PC) (driver out of date)
I've been using the CS6 beta about two days. While experimenting with color range I experienced two consecutive blue screen crashes. The first time it happened,I was working with the color range selector and was replacing the selected areas with another color using the paint bucket. About the third time I attempted this, my PC blue screened. The second time, I opened a photo, went to Select>Color Range and got an immediate blue screen crash.
I then went back to CS5 and I've been playing with the same scenario with no apparent problems.
My PC is a store built computer. It consists of an MSI 990-FXA GD80 motherboard, an AMD Phenom 1100t CPU, Asus GTX550 Ti graphics card and 8 gig of RAM. It boots from a 60 gig SSD and my programs reside on a 500 gig hard drive. The OS is Windows 7 Professional 64 bit. CS6 is using the hard drive for its scratch disk and Photoshop is using 4339 mb of the 7232 mb of available RAM - I haven't changed that. I'm running CS6 as administrator because the way it installed, it would only run in that fashion.
One disappointment during the installation was CS6 made no attempt to read my preferences from the CS5 install. That may be covered in another post, I've not yet looked.
Please keep us informed as new betas are released, because I would like some time to work with this puppy before plunking down big bux for the upgrade. As it is now, I'm going back to CS5. I get mighty nervous when my super computer blue screens!
Gerry
gswetsky AT bellsouth DOT netThe GPU is often at root of issues like yours. I've had so many problems with Nvidia drivers for their gaming-oriented adapters (like yours) that I finally went with one of their workstation cards. I have a Quadro card with just enough RAM to make Photoshop happy. The workstation drivers are optimized for reliability, the consumer card drivers are optimized for gaming and that often means they're less stable and reliable with Photoshop.
-
Devolped an ALV report for daily cash receipts for selected date range
hi,
how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report.hi,
how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report. -
How to change "Select a content category " text
Hi folks,
I really appreciate the support community, as I did deeper and deeper into the produce I've seen the same handful of names pop up across the board! Thanks for all your help!
I was wondering how to change the "Select a content category>>" text that displays in a traditional skin next to your content categories upon generation. Specifically this:
Is there a way to edit the text? Mine are focused on government levels and I'd like to make it easier for users.
Thanks! Happy New Year!Hi there
I believe you do it as follows:
Click File > Project Settings.
Ensure the General tab has focus.
Click the Advanced... button.
Click the LNG File tab.
Scroll the list to the [WebHelp] section.
Locate the item that reads: ContentCategoryList=Select a content category.
Click on it to select it.
Click the Edit button.
Change the text following the equals sign it to what you want it to read.
ContentCategoryList=Change this text
Press Enter to accept the change.
Click OK to dismiss the dialogs.
Generate and test!
Hope this helps... Rick -
How do I select a range of values in MySQL using a drop down menu
Hi,
I have a database of picture frames that have a value of
frame width. I want to be able to select a range of values (i.e.
.50" to 1") instead of each and every value (i.e. .50", .56", .76",
etc.). I have a drop down menu (mnuWidth) with 5 ranges (see
attached code).
Each selection has a value from 1 to 5 indicating the range I
want to search. In my results page I have let DW set up a recordset
(see attached code)
Can anyone tell me how to get this to choose a range instead
of just the value entered by my menu?
Thanks in advance.
TomI have been growing fond of lookup tables. Your lookup table would have your numbers in one column and the values you want returned in the next.
Lookup table
item
Name
1
a
2
b
3
c
4
d
5
e
6
f
7
g
8
h
9
i
Input table
input
Name
1
a
B2 and copied down:
LOOKUP(A2,lookup::$A$2:$A$11,lookup::$B$2:$B$11)
Caution: Lookup will return the closest value so it it looks for "10" in this example it will return "i"
If you don't want to see the error messages from blank inputs, wrap Lookup in IFERROR.
hope this helps
q -
How do I select a range of rows from an internal table in the debugger?
Hi,
I have a case where I wanted to delete a range of rows (several thousand) from an internal table using the debugger.
It seems that rows can only be selected one at a time by selecting (clicking) on the far left side of the row.
This is cumbersome, if not impossible when wishing to delete several thousand rows.
Other tools, such as Excel for example, allow for selecting a range of rows by selecting the first row and then holding the SHIFT key and selecting the last row and all rows in between will be selected.
I can't seem to find the combination of keys that will allow this in the table (or structure) tab of the debugger.
Is it possible to select a range of rows without having to select each row one at a time?
Thanks for your help,
AndyWhile it's a Table Control and should/could have a button to select all fields (or visible fields)...I don't think we can do it right now...I know it's a pain to select each row one at a time...but I don't we have any more options...
Greetings,
Blag. -
File Count with selected date range
Hi,
Our requirement is to get the file count with selected date by the user from two sharepoint date time controls i.e. dtp1 and dtp2 into the data table. I am able to get the file count of specific folder from Pages library through below code. Now need to get
the selected date range from two date time picker controls and check with the item created by is within the date range. If yes I need to get the file count.
So please share your ideas/thoughts to do the same.
SPList list =
wikiweb.Lists["Pages"];
SPFolderCollection oFolders
= list.RootFolder.SubFolders["foldername"].SubFolders;
DataTable dt
= new DataTable();
dt.Columns.Add("Column1");
DataRow dr;
if (oFolders.Count
> 0)
foreach (SPFolder oFolder in oFolders)
if (!oFolder.Name.Equals("Forms"))
dr
= dt.NewRow();
dr["Column1"] = oFolder.ItemCount.ToString();
dt.Rows.Add(dr);
Regards,
Sudheer
Thanks & Regards, SudheerHi,
I have modified the code as below
if((DateTime)(oFolder.Item.File.TimeCreated>dtFromDate.SelectedDate)&&(DateTime)(oFolder.Item.File.TimeCreated<dtToDate.SelectedDate))
But still it is throwing the error.
Please share your ideas on the same.
Regards,
Sudheer
Thanks & Regards, Sudheer -
Select a range of rows to be displayed using ROWNUM
I am trying to select a range of records to be displayed using Rownum
It works using MINUS
SQL> select rownum,department_id,department_name from departments where rownum <= 20
minus
select rownum,department_id,department_name from departments where rownum < 11;
but does not work if a range is specified
select rownum,department_id,department_name from departments where rownum >= 11 and rownum <= 20;
What has gone wrong?
Details of what I have tried are as follows:
Connect to the sample schema HR
SQL> connect hr/hr
SQL> desc departments
Name Null? Type
DEPARTMENT_ID NOT NULL NUMBER(4)
DEPARTMENT_NAME NOT NULL VARCHAR2(30)
MANAGER_ID NUMBER(6)
LOCATION_ID NUMBER(4)
List all records in Departments
SQL> select rownum,department_id,department_name from departments;
ROWNUM DEPARTMENT_ID DEPARTMENT_NAME
1 10 Administration
2 20 Marketing
3 30 Purchasing
4 40 Human Resources
etc......
26 260 Recruiting
27 270 Payroll
27 rows selected.
List the first 10 records in DEPARTMENTS
SQL> select rownum,department_id,department_name from departments where rownum <= 10;
ROWNUM DEPARTMENT_ID DEPARTMENT_NAME
1 10 Administration
2 20 Marketing
etc.....
10 100 Finance
List row number from 11 to 20, but cannot no rows selected. Why?
SQL> select rownum,department_id,department_name from departments where rownum >= 11 and rownum <= 20;
no rows selected
Use of MINUS can retrieve row number from 11 to 20
SQL> select rownum,department_id,department_name from departments where rownum <= 20
minus
select rownum,department_id,department_name from departments where rownum < 11;
ROWNUM DEPARTMENT_ID DEPARTMENT_NAME
11 110 Accounting
12 120 Treasury
13 130 Corporate Tax
14 140 Control And Credit
15 150 Shareholder Services
16 160 Benefits
17 170 Manufacturing
18 180 Construction
19 190 Contracting
20 200 Operations
10 rows selected.For each row returned by a query, the ROWNUM pseudocolumn returns a number indicating the order in which Oracle selects the row from a table or set of joined rows. The first row selected has a ROWNUM of 1, the second has 2, and so on.
Conditions testing for ROWNUM values greater than a positive integer are always false. For example, this query returns no rows:
SELECT * FROM employees
WHERE ROWNUM > 1;
You can get the selected records based on the rownum using the inline query....
SQL> select rownum, empno from emp;
ROWNUM EMPNO
1 7369
2 7499
3 7521
4 7566
5 7654
6 7698
7 7782
8 7788
9 7839
10 7844
11 7876
ROWNUM EMPNO
12 7900
13 7902
14 7934
14 rows selected.
SQL> select * from (select rownum rn, empno from emp) where rn > 2 and rn < 5;
RN EMPNO
3 7521
4 7566 -
Acrobat 9 Pro Cannot select image and overlapping text
I want to copy a section of a newspaper page that includes both text and graphics and keep it looking the same.
When I draw the select box around the section using the mouse the box just disappears when I let go of the mouse button.
I already did the
Make Select Tool Selct Images Before Text thing.
The touch up tool does not select the area I want as a whole, just pieces.
Thanks for you help.The Select Object tool only selects one image (or text selection) at a time. Try using the Snapshot tool instead.
-
Need to implement auto suggest with multiple select in a input text field
Hi,
Jdev Ver: 11.1.1.4
My requirement is to create an input field where i can provide auto suggest and user can enter multiple email ids. It is similar to current "To" field while composing a mail in Gmail.
Problem:
I have implemented input box with auto suggest. For the first entry it works fine. when i enter 2nd value(i have used ',' (comma) as separator and handled it in 'suggestItems' bean method to take sub-string after comma for providing the suggestion) , after selection.... the first value get lost. So at a time only one value is selected in the input text.
Input text:
<af:inputText label="Names" id="it21" rows="2"
columns="50" simple="true"
valueChangeListener="#{VisitBackingBean.visitMembersInputBoxCL}"
binding="#{VisitBackingBean.visitMembersInputBox}">
<af:autoSuggestBehavior suggestItems="#{VisitBackingBean.onSuggest}"/>
</af:inputText>
Bean Method:
public List onSuggest(FacesContext facesContext,
AutoSuggestUIHints autoSuggestUIHints) {
BindingContext bctx = BindingContext.getCurrent();
BindingContainer bindings = bctx.getCurrentBindingsEntry();
String inputNamevalue = autoSuggestUIHints.getSubmittedValue().trim();
if(inputNamevalue.contains(",")) {
inputNamevalue = inputNamevalue.substring(inputNamevalue.lastIndexOf(",")+1).trim();
//create suggestion list
List<SelectItem> items = new ArrayList<SelectItem>();
// if (autoSuggestUIHints.getSubmittedValue().length() > 3) {
OperationBinding setVariable =
(OperationBinding)bindings.get("setnameSearch");
setVariable.getParamsMap().put("value",
inputNamevalue);
setVariable.execute();
//the data in the suggest list is queried by a tree binding.
JUCtrlHierBinding hierBinding =
(JUCtrlHierBinding)bindings.get("AutoSuggestName_TUserROView1");
//re-query the list based on the new bind variable values
hierBinding.executeQuery();
//The rangeSet, the list of queries entries, is of type //JUCtrlValueBndingRef.
List<JUCtrlValueBindingRef> displayDataList =
hierBinding.getRangeSet();
for (JUCtrlValueBindingRef displayData : displayDataList) {
Row rw = displayData.getRow();
//populate the SelectItem list
items.add(new SelectItem(rw.getAttribute("UsrUserName").toString().trim() +
"<" +
rw.getAttribute("UsrMailId").toString().trim() +
">",
rw.getAttribute("UsrUserName").toString().trim() +
"<" +
rw.getAttribute("UsrMailId").toString().trim() +
">"));
return items;
Please suggest how can i achieve the mentioned functionality.Hi,
doesn't work this way as the suggest list returns a single value. You can actually use the existing values as a prefix to the new value in which case the suggest list would look a bit odd. Beside of this all you can do is to create a user lookup field with auto suggest and once a name is selected, update another field with the value returned from this action
Frank -
Select, Copy and Paste text - the iPhone can't do that either???
Select, Copy and Paste text - the iPhone can't do that either??? OK, this is pretty lame...the iPhone does not allow you to select, copy or paste text in SMS, Notes, Safari or Mail. Is this just a oversight on the part of Apple?
Apple left out a LOT of basic functionality from the iPhone. I think they believe that the 'sexiness factor' will far outweigh the need for functionality in getting this phone to sell. For the most part they were right. Now that most of us have realized what this phone cannot do, and that the honeymoon is over (well, for the most part) I hope that Apple will do include some of that basic functionality in future updates. I also hope that the 3G phone is not the answer to this because that will leave out a lot of users who want these basic features but who dont really want 3G.
-
Display key in the selection screen and Key & Text in the report
Hi,
For the infoobject in the query,
In the variable selection screen When i want to select any value it should display only key, and in the report i want to display key and text of that infoobject.
Is it possible?
Thanks
RaniHi
Display As
Here you determine whether and in what format the individual characteristic values of the characteristic are presented:
· (Standard): The standard display type for characteristic values corresponds to the setting in InfoObject maintenance under Tab Page: Business Explorer.
· No Display: The characteristic display is hidden. This function is useful, for example, with the currency/unit characteristic as the currencies are also shown in the key figures.
· Key and Text: The characteristic values are displayed by their technical key and text.
· Text: The characteristic values are displayed by their text.
· Key: The characteristic values are displayed by their technical key.
· Text and Key: The characteristic values are displayed by their text and technical key.
In the dropdown box below, you can select the type of text you want to use if you set a display type that contains text. The following options are available:
· Standard: The shortest available text for the characteristic values is used as the text.
· Short text: The short text for the characteristic values is used as the text.
· Long text: The long text for the characteristic values is used as the text.
· Medium text: The medium text for the characteristic values is used as the text. -
As one of the project requirements, I have to provide a
functionality in my application to be able to change the selection
color of the text box. Having no provision in Flash, I searched on
the net and found one good example of doing that with
flash.geom.ColorTransform and TextFormat classes. It works fine
with windows. However, it doesn't work on Mac OSX. I am using Flash
8 with AS 2.0 for development.
I am seeking some support from all the brilliant developers
here. Can somebody help me with a solution to this problem?Create 4 radio buttons, all called the same name, but with export values of cent.grn, cent.amb, cent.red, cent.blk.
Then use this as the custom calculation script for the text field:
var v = this.getField("myRadioButtons").value; //Replace myRadioButtons with the name of your radio button group
if (v=="cent.grn"){
this.getField("tf.assmnt.stat").fillColor = color.green;
else if (v=="cent.amb"){
this.getField("tf.assmnt.stat").fillColor = [ "RGB", 1,.5,0 ];
else if (v=="cent.red"){
this.getField("tf.assmnt.stat").fillColor = color.red;
else if (v=="cent.blk"){
this.getField("tf.assmnt.stat").fillColor = color.black;
Maybe you are looking for
-
Does ANYONE understand this? I need an expert.
Here is the scenario: 1. I recorded 48 minutes of video on a Canon HDC-TM700 HD camera. 2. I copied the video file (Clip #5.mov) to a Mac Book Pro. The original file size is 50.16GB 3. Opened the file in Final Cut Pro and Exported the file to QuickTi
-
Can I get both time and date in every single message that I receive or send?
I have been usine iPhone for a while now, and I was wondering if you can change the message-settings somehow, so that I can see both date and time in every single message, instead of every 30 minutes, is this possible?
-
Vendor inclusion of purchase org
Hi guru, I have created a vendor without purchse organisation.Now can i add purchase org to it?pls guide how to do it? Thnx in advance vikas
-
I am trying to import my photos from ipad to computer (hp windows 7). Do I need to download anything first?
-
why can I not use photo stream on my iMac? i am signed into icloud in aperture I click on turn on photo stream ... it sais enabling and comes back with Aperture was unable to connect to photo stream Peter