[CS3 JS] Finding paragraph containing table

I have a table object and want to find the paragraph that contains the table. Then I want to return the contents of the paragraph previous to the table anchor. I am using this, but when I attempt to display the contents of the paragraph, I get "Object is invalid". Thanks for any help you can provide.
// Get the paragraph inside the table.
var oPgf = app.selection[0].paragraphs[0];
// Make sure the paragraph is in a cell.
if (oPgf.parent.constructor.name === "Cell") {
  // Get the parent cell and table objects.
  var oCell = oPgf.parent;
  var oTbl = oCell.parent;
  // Get the paragraph containing the table.
  var oPgf2 = oTbl.storyOffset.paragraphs[0];
  // Get the story object of the paragraph.
  var oStory = oPgf.parentStory;
  // Get the paragraph's index.
  var iPos = oPgf2.index;
  // Display the contents of the paragraph before the table anchor.
  alert (oStory.paragraphs[iPos-1].contents);
Rick Quatro
585-659-8267

I found a previous post that is helping me with this.
// Paragraph inside of table.
var oPgf = app.selection[0].paragraphs[0];
// Make sure the paragraph is inside a table
if (oPgf.parent.constructor.name === "Cell") {
  var oCell = oPgf.parent;
  var oTbl = oCell.parent;
  // Get the paragraph containing the table anchor.
  var oPgf2 = oTbl.storyOffset.paragraphs[0];
  // Loop from the table anchor to the top of the story.
  while (oPgf2) {
    $.writeln(oPgf2.constructor.name);
    oPgf2 = oPgf2.parentStory.paragraphs.previousItem(oPgf2);
This basically works, except this line gives an "Object is invalid" error when it gets to the beginning of the story:
oPgf2 = oPgf2.parentStory.paragraphs.previousItem(oPgf2);
I can use a try statement, but I am wondering why the loop doesn't exit gracefully without an error. Thanks.
Rick

Similar Messages

  • How to find out the table name

    hi,
    how to find out the table name in which the data from a particular structure in a particular screen is saved,
    please tell me the procedure to find out the table name for saving the structure data that is inputted at runtime.
    Thanks,
    chinnu

    Hi Chinnu,
    Below are the tables that are referred to find out the table names
    DD02L Table contains the SAP Tables.
    DD02T Table contains the SAP Table Texts.
    DD01L Table contains the Domains
    DD01T Table contains the Domain Texts.
    DD03L Table contains the Table Fields.
    DD03T Table contains the Table Field Texts. (Language Dependent)
    DD04L Table contains the Data Elements.
    DD04T Table contains the Data Element Texts.
    DD05s Table contains the Foreign Key Fields
    last words with L and T only. L->Database Fetch T-> Text
    And the procedure to retrive the table name is as follows
    1. Go to se11
    2. Enter table name DD03T and execute
    3. In the next screen you can find Tables, fields, test etc. there you can enter the field name in the fields 
      and execute.
    4. you can get all tables which contains the field.
    I hope this will solve your problem
    Regards,
    Chandru

  • How to search this value in oracle database to find out the table

    Hi expert,
    I know there is a value in oracle database, please show me how to search this value in oracle database to find out the table holding this value.
    Many Thanks,

    918440 wrote:
    Hi friends,
    this question is really practical, I already know there is value from application saved in database, I want to search the whole database to figure out which table the value is contained.write SQL that writes SQL to query every table.
    Handle:     918440
    Status Level:     Newbie
    Registered:     Mar 2, 2012
    Total Posts:     20
    Total Questions:     10 (10 unresolved)
    why do you waste time here when you NEVER get any answer to any question you post?

  • Need help for finding oracle payables tables

    Hi,
    I need help for finding tables relating fields INVOICE_ID, NOTIFICATION_ID and APPROVAL_STATUS or WFAPPROVAL_STATUS. I have searched a lot but has been unable to find any table containing all the above mentioned fields. I found the table WF_NOTIFICATIONS for INVOICE_ID, however have been unable to find the latest tables with INVOICE_ID and APPROVAL_STATUS as fields.
    All the tables having this combination are either very old tables which are not used anymore or doesnt give the required data. Please let me know where am i going wrong. Once i get the required tables, i need to join the tables to get the required data with the imp fields. Also, the values of WFAPPROVAL_STATUS are not very clear to me. I need values for it as APPROVED, REJECTED AND INITIATED.

    Hi Swetha,
    You will have to manually make the table adjustments in all the systems using SE14 trans since the changes done using SE14 cannot be collected in any TR.
    How to adjust tables :
    Enter the table name in SE14. For ex for any Z master data(Say ZABCD), master data table name would be /BIC/PZABCD, text table would be /BIC/TZABCD. Similarly any DSO(say ZXYZ) table name would be /BIC/AZXYZ00 etc.
    Just enter the table name in SE14 trans --> Edit --> Select the radio button "Save Data" --> Click on Activate & adjust database table.
    NOTE : Be very careful in using SE14 trans since there is possibility that the backend table could be deleted.
    How to collect the changes in TR:
    You can collect only the changes made to the IO --> When you activate, it will ask you for the TR --> Enter the correct package name & create a new TR. If it doesn't prompt you for TR, just goto Extras --> Write transport request from the IO properties Menu screen. Once these IO changes are moved successfully, then the above proceduce can be followed using SE14 trans.
    Hope it helps!
    Regards,
    Pavan

  • Query to find out the table name and column name..

    Hi Experts,
    I have an Oracle DB in which has more than 50 tables and 100,000 records. I want to get the record which contains *"ITxtVarValue references a non existing text"* the text.
    Is there any query there to find out the table name and column name of this particular record where it reside?
    Please help. Any help will be rewarded.
    Thanks,
    G

    Using this forum's search function, I found a thread that should give you an idea: How to find out a tablename
    C.

  • Desktop Manager 4.7 (Cannot find system in table file.)

    I just updated from Desktop Manager 4.2 to 4.7 on Windows Vista for my Blackberry 8800.  When I try to configure synchronization for Microsoft Outlook and click Finish I get the error message "Cannot find system in table file".  I've checked everywhere and I cannot find a solution for this problem.  Can anyone please help point me in the right direction?  Thanks in advance!
    Solved!
    Go to Solution.

    Hi and welcome to the forums!
    Upgrading has left some files registered with the wrong or old versions of software.
    See the attached link for resolution.
    Thanks,
    Bifocals
    Please remember to resolve your thread.
    Put the check mark in the green box that contained your answer! Thanks 
    http://www.blackberry.com/btsc/search.do?cmd=displayKC&docType=kc&externalId=KB15278&sliceId=2&docTy...
    Click Accept as Solution for posts that have solved your issue(s)!
    Be sure to click Like! for those who have helped you.
    Install BlackBerry Protect it's a free application designed to help find your lost BlackBerry smartphone, and keep the information on it secure.

  • Cannot find system in table file

    I got the 8900 series and I upgraded the desktop software to v4.7
    I am trying to synchronize with outlook, but when I am configuring it when I click finish it appear this run time error 'cannot find system in table file'
    I uninstalled and installed again the desktop software and there was no change.
    I tried removing something of connectors and it didn't help.
    Can someone please help me with this.
    Thanks.

    Hi and Welcome to the Forums!
    Here is a KB that discusses that error:
    KB15278 Receiving error "cannot find table in system file" when attempting to configure BlackBerry Desktop Manager synchronization
    Hopefully it contains something useful!
    Good luck and let us know!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How can I find overlapping pivot tables?

    I am getting errors in my Excel workbook that contains around 50 reports that say "A pivot table cannot overlap another pivot table". I tried to insert rows inbetween tables on each worksheet but it did not solve the issue. How can I find
    which reports are overlapping, and is there a way to correct this without re-creating reports?

    Linda,
    Here is the full link to the page David linked:
    http://answers.microsoft.com/en-us/office/forum/office_2007-excel/finding-overlapping-pivot-tables/08ab3afa-a79e-4be5-a127-0760f0f9c633
    Hope this helps,
    David

  • Tcode to find the fields ,tables based on description of fields

    hi folks,
    tcode to find the fields ,tables based on description of fields,POINTS  will be awarded for the answers ,plz give reply.

    Hello Kumar
    Table DD03T contains the field descriptions.
    Regards
      Uwe

  • How to find the contain of @list_of_cols_val_tab_del

    Hi
    Could you please tellme how to find the contain of @list_of_cols_val_tab_del
    for a given table when we write a stored procedure in SBO_SP_TransactionNotification.
    Thanks
    Sanjaya

    The way I have handled is by inserting the values being passed to this SP to a temp table
    INSERT INTO TRANSNOTIFY VALUES (@object_type, @transaction_type, @num_of_cols_in_key, @list_of_key_cols_tab_del, @list_of_cols_val_tab_del)
    Use this script to create this table
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo\].[TRANSNOTIFY\](
         [ObjType\] [nvarchar\](20) COLLATE SQL_Latin1_General_CP850_CI_AS NULL,
         [TransType\] [nchar\](1) COLLATE SQL_Latin1_General_CP850_CI_AS NULL,
         [NumCols\] [int\] NULL,
         [KeyCols\] [nvarchar\](255) COLLATE SQL_Latin1_General_CP850_CI_AS NULL,
         [ColsVal\] [nvarchar\](255) COLLATE SQL_Latin1_General_CP850_CI_AS NULL
    ) ON [PRIMARY\]

  • How do i find out the tables (data)effected in a schema after a particular time stamp

    how do i find out the tables (data not structure)effected in a schema after a particular time stamp?
    pls email in [email protected]

    You can't do that. That would be a real security risc.
    /KAj

  • How do i find out the tables effected in a schema after a particular time stamp

    how do i find out the tables effected in a schema after a particular time stamp?
    pls email in [email protected]

    If you are doing a reload every time then you can issue following commands to clear data from cube.
    lmt name to all
    allstat
    clear all from <cubename>prttopvar
    You can wrap above commands in pl sql procedure using dbms_aw.execute package and execute it before cube load starts. Instead of clearing it from whole cube you can clear only from one partition also. Just take a look at clear command in olap DML 10.2 reference.
    Thanks,
    Brijesh
    Edited by: Brijesh Gaur on Aug 10, 2010 6:47 AM

  • How to find out which table store historical data for V_T001B?

    dear all,
    how i want to trace and find out which table that store all maintenance data history from V_T001B?
    thanks.

    i already find out into both table... but the data not store there...

  • How to find out the tables from extract structures

    Hi All,
    As I know my data sources are 2lis_04_p_matnr,2lis_04_p_comp,2lis_04_p_arbpl.
    How to find out the tables concerned with the fields in the extract structure.
    Thanks

    Pl check this link:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/29/79eb3cad744026e10000000a11405a/frameset.htm
    OR navigate to: help.sap.com - netweaver - bi content - supply chain - look for your application area and the extractor and you will see the source tables and fields.
    Ravi Thothadri

  • How to find names of tables created by specific user

    I have tried;
    select * from dba_tables
    and
    select * from users_tables
    and it shows 1600 + and 900+ tables resp. I just need to find out the tables created by me.
    any help or guidance is greatly appreciated.

    Hi,
    Welcome to the forum. This may help you.
    select * from dba_objects where object_type='TABLE' and owner = <user>
    select * from user_objects where object_type='TABLE'cheers
    VT

Maybe you are looking for

  • Absence Quota to be generated on basis of Working Day

    Hi Experts, I have got a scenario in Time management ( negative time management, no time evaluation) where the client wants absence quota to be generated on the basis of working days of employee. I have checked the configuration for creating base ent

  • Issues with Photoshop CC 2014

    I have lost the ability to be productive since purchasing the photographers CC plan and installing Photoshop CC 2014. 1. Send photo from Lightroom 5.7 to PSCC 2014 then edit using photoshop and NIK collection plugin. Photo begins to loads into PSCC20

  • I would like to know if the face time app can be activated once I get back home to my country in Philippines? I bought my iPad mini in Qatar.

    I would like to know if face time app can be activated once my iPad mini is used in my home country in the Philippines. I bought it in Qatar and I learned that face time app was disable in this region also.

  • How to manually generate events in SMC 3.5 ?

    Dear, We are using the SDK of SMC 3.5 to build an application. To test the application, how can we generate events manually ? I'd like to have a script on Solaris that, when run, generates an event in the SMC database. Does anyone have such a script

  • Restrict number of rows in table view

    Can a table view has only as many rows as the actual rows in the underlying data structure. Actually, I have a table view with less than 5 rows, but the tableview shows like 15+ rows with the rest of the rows as blank(alternative colors for each empt