Centering a table in Word LabWindows

Hello all!
    I create a table in Word using Microsoft Word 9.0 Object Library (word2000.fp) and I have a problem with centering a table in document. I have created correctly table but I can't centered a table in my document page. I have tired all possible of ways to center a table but no results. I don't know what I'm doing wrong. Please help on the issue. Below I add a piece of my code written in Labwindows/CVI:
     Word_GetProperty (docHandle, NULL, Word_DocumentApplication,
                              CAVT_OBJHANDLE, &appHandleL);
     Word_GetProperty (appHandleL, NULL, Word_ApplicationSelection,
                   CAVT_OBJHANDLE, &currSelHandleL);
     // adding paragraph
     Word_SelectionTypeParagraph (currSelHandleL, NULL);
     Word_GetProperty (currSelHandleL, NULL, Word_SelectionRange,
                   CAVT_OBJHANDLE, &rangeHandleL);
     // creating a table
     Word_GetProperty (docHandle, NULL, Word_DocumentTables, CAVT_OBJHANDLE, &tablesHandleL);
      Word_TablesAdd (tablesHandleL, NULL, rangeHandleL, 5, 6,CA_VariantInt(1) , 
                  CA_VariantInt(0), &tableHandleL );  
      //Word_TableSelect (tableHandleL, NULL);
      // centering a table
      Word_GetProperty (currSelHandleL, NULL, Word_SelectionTables, CAVT_OBJHANDLE, &tablesHandleL);
      //Word_SetProperty (tablesHandleL, NULL, Word_RowsWrapAroundText, CAVT_BOOL, FALSE);
      Word_SetProperty (tablesHandleL, NULL, Word_RowsAlignment, CAVT_LONG,
                WordConst_wdAlignRowCenter);
What am I doing wrong? How should be correctly it?
      I greet    Theodore
Solved!
Go to Solution.

Hi Tamás Simon,
   My version of CVI and OS what I'm using it's: CVI 8.5 and Windows XP Professional SP3, but ones are alright. I have found solution to my problem. The issue was lying in incorrect use of objects in the called function Word_SetProperty ( ). I used the syntax:
      Word_SetProperty (tablesHandleL, NULL, Word_RowsAlignment, CAVT_LONG, WordConst_wdAlignRowCenter);
and it should be as:
      Word_SetProperty (WordObjRows, NULL, Word_RowsAlignment, CAVT_LONG, WordConst_wdAlignRowCenter);
The entrie code source to create a table with centering should look like this:
int CVICALLBACK Add_Table (int panel, int control, int event,
              void *callbackData, int eventData1, int eventData2)
     WordObj_Columns                   WordObjColumns;
     WordObj_Rows                        WordObjRows;
     WordObj_ParagraphFmt          WordObjParagraphsFmt;
     WordObj_Paragraphs              WordObjParagraphs;
     WordObj_Range                      rangeHandleL;
     WordObj_Table                        tableHandleL;
     WordObj_Tables                      tablesHandleL;
     WordObj_Selection                  currSelHandleL;
     WordObj_Application               appHandleL;
     switch (event)
      case EVENT_COMMIT:
          Word_GetProperty (docHandle, NULL, Word_DocumentApplication,
                              CAVT_OBJHANDLE, &appHandleL);
          Word_GetProperty (appHandleL, NULL, Word_ApplicationSelection,
                              CAVT_OBJHANDLE, &currSelHandleL);
          // adding paragraph with centering property
          Word_GetProperty (docHandle, NULL, Word_DocumentParagraphs,
                              CAVT_OBJHANDLE, &WordObjParagraphs);
          Word_GetProperty (WordObjParagraphs, NULL, Word_SelectionParagraphFormat,
                              CAVT_OBJHANDLE, &WordObjParagraphsFmt);
          Word_SetProperty (WordObjParagraphsFmt, NULL, Word_SelectionParagraphFormat,
                              CAVT_OBJHANDLE, &WordObjParagraphsFmt);
          Word_SetProperty (WordObjParagraphsFmt, NULL, Word_ParagraphFmtAlignment,
                              CAVT_LONG, WordConst_wdAlignParagraphCenter);
          Word_SelectionTypeParagraph (currSelHandleL, NULL);
          Word_GetProperty (currSelHandleL, NULL, Word_SelectionRange,
                              CAVT_OBJHANDLE, &rangeHandleL);
           // creating a table
          Word_GetProperty (docHandle, NULL, Word_DocumentTables, CAVT_OBJHANDLE, &tablesHandleL);
          Word_TablesAdd (tablesHandleL, NULL, rangeHandleL, 5, 6,
                             CA_VariantInt(1), CA_VariantInt(0), &tableHandleL);
          // setting rows and columns size the table
          Word_GetProperty (tableHandleL, NULL, Word_TableRows, CAVT_OBJHANDLE,
                             &WordObjRows);
          Word_GetProperty (tableHandleL, NULL, Word_TableColumns,
                            CAVT_OBJHANDLE, &WordObjColumns);
          Word_SetProperty (WordObjRows, NULL, Word_RowsHeight, CAVT_FLOAT, 20.5);
          Word_SetProperty (WordObjColumns, NULL, Word_ColumnsPreferredWidth,
                            CAVT_FLOAT, 40.5);
          // centering the table
          Word_SetProperty (WordObjRows, NULL, Word_RowsAlignment, CAVT_LONG,
                            WordConst_wdAlignRowCenter);
        break;
 return 0;
I added also some table properties, such as size rows and columns, paragraph with centering. I hope that it will be useful to someone.
         I would like to thank you for your help and wish you all the best
         Theodore85

Similar Messages

  • Create PDF Acrobat X Pro - does not display embedded excel 2010 tables in word 2010 properly

    Hello,
    I bought Acrobat X Pro and the first document I used 'Create PDF' on was a Word 2010 document with embedded (read linked) Excel 2010 tables.
    When I opened the document after creating it the linked tables had a little arrow in the corner of a white box with a help text message of "click here to activate". The pdf is basically unusable.
    Is there a setting to ensure that these embedded excel tables are created as normal tables - I do not want to have to keep pasting in tables/images into my Word documents when they are all updating automatically.
    Thanks in advance for any help you can give me.
    Regards,
    Craig

    Hello,
    i am having exactly the same issue with Acrobat X Pro - with linked Excel 2010 tables in Word 2010.
    Has there been a resolution to this eissue - it is potentially very time consuming to work around this issue for me.
    I would post my files but I don't know how to attach them to the thread - only my second post .
    Cheers,
    slobbering_dog
    This is the Word File - the table is an Excel 2010 spreadsheet linked (via Paste Special >Link) .
    This is the resultant PDF file:
    Thanks in advance - again !!
    Message was edited by: slobbering_dog_72

  • Insert table into word document

    Good day,
    I am creating a Word document using a workflow and saving it to a library. I am then updating metadata which pulls through into the word document through Document property mapped fields.
    I however need to insert a table with data from a SharePoint list.
    I am using a Visual Studio workflow so I need any direction or samples on how to do this.
    Thank you!

    Hi,
    We can use Open XML to achieve it, here are some articles from MSDN for your reference:
    Generating Documents from SharePoint Lists using Open XML Content Controls
    http://blogs.msdn.com/b/ericwhite/archive/2009/10/14/generating-documents-from-sharepoint-lists-using-open-xml-content-controls.aspx
    How to: Insert a table into a word processing document (Open XML SDK)
    https://msdn.microsoft.com/en-us/library/office/cc850841.aspx
    Walkthrough: Creating a Table in Word
    https://msdn.microsoft.com/en-us/library/office/aa192483(v=office.11).aspx
    Best Regards,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Copy table from Word into DreamWeaver

    I have a 26 x 5 table in Word which I wish to copy into
    DrreamWeaver 7.0,. Could someone please tell me how? Thanks,
    Bill

    Copy - Paste works for me....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Nick Barling" <[email protected]> wrote in
    message
    news:fdmn6q$sni$[email protected]..
    > Use import tabular data. Check this reference out:
    >
    >
    http://livedocs.adobe.com/en_US/Dreamweaver/9.0/help.html?content=WSc78c5058ca073340dcda91 10b1f693f21-7ce7.html
    >

  • Importing Tables from Word Documents

    I have a new job where the majority of my colleagues are PC users and we must work on common documents. I have no problem saving documents as a word file and opening word documents. But I have had some issues with Tables coming from a word document. I looked on the forum and learned about inline tables but I have been unable to take a table from a .doc file and change it to an inline table. Basically when the page ends, the table stops, even when there is more text. It is making it really frustrating for work as I have been copying and pasting the text from the table into a new document to edit it and then replacing the new text with the old. Can anyone help me figure out how to see the text in tables from word documents??
    Thanks,
    Amber

    It would be more efficient to use the true Office or one of the free clones: openOffice & neoOffice.
    Yvan KOENIG (VALLAURIS, France) Sunday, September 13, 2009 11:56:23

  • Insert value from an interanal table to a table in word

    dear all
    can anyone tell me how to insert the data from  an internal table to the table created  in word, i can insert data  to the table of word by hard coding it,but finally the data has to come from  an internal table, im using OLE concept so code related to that will be highly appreciated. the functionality is the same as ALV gives to excel download,but just in my case it has to be in word,
    please help me i m in real need
    Regards
    Swarnali

    Hi
    If they have the same structure u can use a do cycle:
    LOOP AT  ITAB_NORMAL.
       DO.
         ASSIGN COMPONENT SY-INDEX OF STRUCTURE ITAB_NORMAL TO <VALUE_FROM>.
         IF SY-SUBRC NE 0. EXIT. ENDIF.   
         ASSIGN COMPONENT SY-INDEX OF STRUCTURE <DYN_WA> TO <VALUE_TO>.
        <VALUE_TO> = <VALUE_FROM>.
       ENDDO.
       APPEND <DYN_WA> TO <DYN_TABLE>.
    ENDLOOP.
    If the dynamic table has only certain fields of ITAB_NORMAL, I suppose u have an internal table with the fields of dynamic table (u should use it to generate the dynamic table) so u can loop it instead of DO/ENDO cycle
    LOOP AT  ITAB_NORMAL.
       LOOP AT ITAB_FIELD.
         ASSIGN COMPONENT ITAB_FIELD-FIELDNAME OF STRUCTURE ITAB_NORMAL TO <VALUE_FROM>.
         ASSIGN COMPONENT ITAB_FIELD-FIELDNAME OF STRUCTURE <DYN_WA> TO <VALUE_TO>.
        <VALUE_TO> = <VALUE_FROM>.
       ENDLOOP.
       APPEND <DYN_WA> TO <DYN_TABLE>.
    ENDLOOP.
    Anyway u can find out many solutions in SCN, there are many posts with your problem
    Max

  • Centering a table

    Hi,
    I have an table in my document. A 5x5 table of some text and numbers. I want to center it (center horizontally) in my text, (with no text to the left and right of the table).
    Someone might suggest the Wrap, but that way I have to drag the table, and guess where the true center is. Plus, doing wrap really messes up the line spacing, because to get the spacing correct between the line appearing after the table I have to change the value of "space before paragraph" to some ridiculously large number. Also, when I change the table a little bit, the whole thing gets mixed up, and I have to drag the table again to the right place. So this is not a good solution!
    Isn't there just a way of selecting the table, and simply Centering it with respect to the page?
    D

    Whether you buy iWork now or wait until January depends how patient you are, and how much you want a spreadsheet with it (which is hoped for: but rumours are rumours!). There will be no "upgrade path." Apple provide minor revisions free via Software Update, but anything involving new features you have to buy again. Consider it subscription ware. It's still a bargain at the price: but maybe not, if you're only going to get 6mths for a year's worth. Upgrading every 2nd year is an often recommended option.
    On the other side of all that, Keynote is a knockout app. And Pages, once you get the hang of its "inspectors" & etc. is far more competent at handling fine typographic design than Appleworks or Word were ever likely to be. Just now its more mundane Word Processing facilities are short of some "bells and whisltles" but once Version Tracking is included - as, again, is rumoured for iWork 07, nobody's going to care. Once you discover what it can do, and that it has layering and transparency capabilities that make it an entry-level Page design program - without the horrendous learning curve of Quark etc., it's frankly an absolute gem. Its measure lies rather in the quality of what you can produce with it, than in any wish-list of features.
    Even with a spreadsheet, it will still be lacking a data-base and drawing app., but given its capacity to handle imported graphics, it still bears promise of becoming a major productivity tool - if more oriented to the individual than corporate use. Personally I think this a good thing, and a fully fledged office suite a white elephant to me. Steve Jobs has called it the replacement for Appleworks - which as yet it is not. But wait and see.
    For writing and publishing with graphics capabilities, and sufficient token of those other bits and pieces the private user may occasionally want, it's already the only show in town. How soon you become acquainted with it, and share its growing pains is up to you. But give it a little time and patience, whichever way you go. What seems counter-intuitive or fiddly at first begins to flow quite soon - and even quicker once you forget all about whatever else you've used and take it on its own terms.
    But get some decent fonts and source or make fine graphics; and then get to know how Pages can fine-tune them, and I can promise that within a month or so you'll be turning out material that leaves Appleworks or Word in the shade. I used to bet that I can spot a Word document from the other end of a bus. Doesn't matter what you do, they all come out the same.
    iWork on the other hand is a creative tool. It's as good as you can be with it.
    Cheers.

  • Hi Sir! I have some questions regarding word report generation please.1.How can i add border to a word page?.2.How can i add grid lines to a table generated in word report?.3.How can i add border to a table of word report?.Thanks Imran Pakistan

    Hi !
    Sir I have some questions regarding word report generation using(C language in labwindows) Please.
    1.How can i add border to a word page?.
    2.How can i add border and grid lines to a table generated in word report(Not the " cvi table control" inserted from gui,i am asking about the table generated in word report)?
    3.How can i fill a cell of word report table withe the data type other than "character"?.
    And sir one question about use of timer in cvi labwindows please.
    Sir i'm trying to set minimum delay interval of timer control to 1millisecond(0.001s),as i set ,timer don't cares of the interval that is set by me it responds only to the default minimum time interval which is i think 10milliseconds(i'am using windows xp service pack3 version 2002).
    Regards
    Imran
    Pakistan
    Solved!
    Go to Solution.

    Hello sir!
    Sir i'm using daq6251.But Sir before implimenting it to my final application now i'm just trying to achieve 1millisecond time interval for timer in a vary simple programe i mean at this time no hardware (daq device) is  involved i,m just trying to achieve minimum time interval of 1millisecond.
    Sir i read form "help" of labwindows how this time interval can be set,i'm trying for,as described in help notes but i could'nt.I'm attaching a screen shot sir for you it may helpful for you to explain me.
    And sir also waiting for your kind reply regarding word report generation.
    Thanks.
    Imran.
    Attachments:
    screen_shot_rigistry.docx ‏65 KB

  • Centering a Table in Pages '09

    My document has a small table in the middle of text. The table (the whole thing, not just the cell text) is against the left margin but I want it centered. The Inspector > Metrics has the X and Y grayed out. How can I center the table? Thanks from a Pages newbie.

    Hi Dr. Dave
    Welcome to the forum.
    Objects can be two sorts.
    Floating which means they can be freely moved anywhere, but can be disassociated from their text.
    In-line which means it is part of the text flow and acts like a rather big letter in the text.
    Your table is, I believe, In-line so can be treated like any other text.
    If it is on its own line you can choose to centre the text (see Toolbar icons) and the table will be centred.
    If it has other text on the same line it can be positioned with tabs and the ruler.
    Or you can go:
    +Inspector > Wrap > Floating+
    Just make sure you have adjusted the word wrap around your object.
    Peter

  • How to delete a row of table in Word using powershell.

    I want to search for a word which is present in Table. If that word is present than I want to delete that row from table.
    Can anybody help me with that. The script I am using is:
    $objWord = New-Object -ComObject word.application
    $objWord.Visible = $True
    $objDoc = $objWord.Documents.Open("C:\temp\Recipe.docx")
    $FindText = "DP1"
    $objSelection.Find.Execute($FindText)
    $objWord.Table.Cells.EntireRow.Delete()
    $objDoc.SaveAs("C:\Temp\P.docx")
    $Doc.Close()

    Maybe try this:
    $objWord = New-Object -ComObject word.application
    $objWord.Visible = $True
    $objWord.Documents.Open("C:\temp\Recipe.docx")
    $FindText = "DP1"
    $objWord.Selection.Find.Execute($FindText) | Out-Null
    $objWord.Selection.SelectRow()
    $objWord.Selection.Cells.Delete()
    $objWord.Documents.SaveAs("C:\Temp\P.docx")
    $objWord.Close()
    $objWord.Quit()
    [System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$objWord) | Out-Null
    This definitely assumes the text you're trying to find only exists in a table, per your specified requirements.  If it exists anywhere else, or in multiple tables, the code above is inadequate.
    I hope this post has helped!

  • Create table in word document

    hi all,
    i create a word document through report.
    is it possible to create a table through abap code?
    thanks,
    dana.

    Hi MOKDEV,
    >>I want to create table of content for word document and i want to get the content of this from page header and then to build the table
    A collection of
    TableOfContents
    objects could represent the tables of contents in a document. When use Add method could add a tablecontent for a word document file. The below code provide a sample to create a tableConetent at the beginning of the document  from all the paragraphs
    styled as either Heading 1, Heading 2, or Heading 3
    Sub AddTableContent()
    Dim myrange As Range
    Set myrange = ActiveDocument.Range(Start:=0, End:=0)
    ActiveDocument.TablesOfContents.Add Range:=myrange, _
     UseFields:=False, UseHeadingStyles:=True, _
     LowerHeadingLevel:=3, _
     UpperHeadingLevel:=1
    End Sub
    Best Regards
    Lan
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Embedded Excel table in Word 2013

    I just purchased a new laptop with Window 8 and Office 2013. Previous Word files with embedded Excel tables will open once then refuse to open a second time. I get an error message, "the program used to create this object is Excel. That program
    us either not installed or your computer..." Both Excel and Word work fine on their own. One thread suggested turning off Add-Ins but I'm not sure how to do that... And it did not seem to work for the other person... HELP!

    Hi,
    In regarding of the issue, I recommend we do some tests to narrow down the issue.
    Create a new Word 2013 file and a Excel 2013 file, and insert the Excel file as object in Word to test.
    If it works fine, we need to repair the previous Word files.
    If it does not work fine, please try to start Word 2013 in
    safe mode (Press Win+R > enter Winword.exe /safe). If it works fine, we'd better check the add-ins both of the Word and Excel:
    In Excel/Word go to file>options>add-ins. Then down the bottom select COM Add-ins from the drop down menu and hit go. Uncheck everything hit ok. Close the options menu close Excel.
    After, we also could update all the latest Office 2013 and Windows 8 patches to test.
    Regards,
    George Zhao
    TechNet Community Support

  • Has anyone had a problem centering labels from microsoft word 2007 using the hp photosmart 7510? my

    Has anyone had a problem with printing labels centered on HP Photosmart 7510 e-All in one?  My labels are printed from Word 2007 and appear on the screen to be centered, however when I print, they are too high on the label.  Also when printing an e-mail the bottom of the page where it lists your email name is cut off.  Please help!!

    Hi,
    I'd been having this problem for probably round 30 years on many printers. I bought a labels printer few years back but I don't print labels everyday now.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How do I open and use a large table from Word in Pages?

    I upgraded my MBP from Snow Leopard to Mountain Lion a couple days ago.  I knew that my old Word application wouldn't work, but several Apple people assured me that Pages could handle my old docs, including tables.
    So, I purchased and installed Pages '09 this morning.  I opened the table I use all the time - - and most of it is missing!  Apparently, Pages doesn't handle large tables.
    I need help - desperately!  This table contains all my medical expenses for the year, so I have to have it.
    Thanks

    J,
    Besides needing to have your Table Object Floating, you should know that the maximum number of rows in Pages Tables is 999.
    If you continue to have problems opening your Word document and its table in Pages, try one of the free Office Clones, LibreOffice, OpenOffice, IBM Lotus Symphony, etc.
    I'd bet that at least one of those free apps will work if Pages doesn't. By the way, have you tried viewing your Word document in Quick Look? To do that, click on the filename in Finder and hit the Spacebar key. You won't be able to do anything but view the document in Quick Look, but it would give you confidence that your file is OK.
    Jerry

  • Scanned tables to word or excel

    Hi,
    I tried to convert a pdf file that contains scanned tables (3 columns: title and two years financial entry). The outcome is not useful as I can not select the number from a particular column: either the whole table is selected or the title and the numbers from 2 columns are selected which are not useful in excel.
    How can I improve the conversion of multi column tables (from a scanned pdf) into word or excel?
    Thanks!

    Good day Cengiz,
    Unfortunately our forums don't allow for file attachments anymore.  If you haven't already done so, please take a moment to fill out the File Conversion Issues Form with a description of the problem as well as a link to this thread and we'll try to give you some more detail.
    Kind regards,
    David
    Acrobart Community Manager
    Adobe Systems

Maybe you are looking for

  • Keynote slides printing puzzle

    I've done a lot of work on Pages over the years, but I'm really inexperienced with Keynote. I want to print some slides (actually web site pages) from a presentation and have each one fill a single 8.5x11 page. I've read Keynote Help – re: Printing S

  • Fnd_request.submit_request CESQLLDR

    Hi Techies, DECLARE l_request_id NUMBER; l_resp_id FND_USER_RESP_GROUPS.RESPONSIBILITY_ID%type; l_resp_appl_id fnd_user_resp_groups.responsibility_application_id%TYPE; BEGIN --Derive Responsibility Application ID and Responsibility ID BEGIN SELECT ap

  • How can I order an installation CD for my PIXMA MP495

    How can I order a installation CD for my PIXMA MP495?

  • Warum synchronisiert Lightroom 5.4 und Photoshop CC nicht Camera Raw 8.4

    Ich hatte bereit diese Frage gestellt. Ich habe in Photoshop CC Camera Raw 8.3.0.141. In Lightroom bekomme ich deshalb immer eine Fehler Meldung und zwar: Um eine vollständige Kompatibilität zu gewährleisten, wird für diese Lightroom Version mögliche

  • Apple Mail versie 6.3 (1503)

    I'm working with Apple Mail Version 6.3 (1503). A new e-mail message is marked as 'read' directly after selection. Is it possible to adjust this? I'd rather see that an e-mail is marked as 'read' after a double-click. Ik werk met Apple Mail Version 6