How to replace a word or line in a word document in CVI

I am trying to edit a word document using activeX in CVI. I want to search for a word and replace it with another. I couldn't find any functions which does the replace in wordreport.c. Could you please help me out?

Hi Isn,
You
will want to use the Microsoft Word 9.0 Object Library to interface
with Microsoft Word.  You could then potentially be able to use the ActiveX calls
provided to accomplish your goal.  The specifics on how to do this
should be found in Microsoft's Documentation.
Refer to the Microsoft document entitled How to find and use Office object model documentation. In your case, you will be looking at the Vbawrd9.chm help file which I believe will be located in the C:\Program Files\Microsoft Office\OFFICE\1033\ directory.
Also refer to the Unable to Load Microsoft Excel/Word Help in LabWindows/CVI KnowledgeBase.
Derrick S.
Product Manager
NI DIAdem
National Instruments

Similar Messages

  • How do I copy a few lines from a pdf document to a Word document?  I'm not looking to convert the whole document, just need to copy a few lines here and there.

    How do I copy a few lines from a pdf document to a Word document?
    I'm not looking to convert the whole document, just need to copy a few lines here and there.
    ps.  Wow, what a user UNFRIENDLY site this is!

    In most cases you can just select the text and copy/paste. You can do that unless the file is a picture/scan.

  • How do I locate the longest line in an InDesign document?

    Is there a script that locates the longest line in an InDesign document?

    Hi Duke;
    The following is something quick and dirty that looks at the number of characters in a line only. This ignores what the others were saying in regards to 'physical space' which may include kerning, scaling, character widths etc, and it only looks at 1 text frame so you might have to expand on it if you want to do a whole document.
    var myLines = app.activeDocument.textFrames.item(0).lines;
    var myLongestLine = 0;
    var myLongestLineGroup = "";
    for (var i = 0; i < myLines.length; i++) {
        if (myLines[i].characters.length === myLongestLine) {
            myLongestLineGroup += "Line - " + i + "\u000D";
        else if (myLines[i].characters.length > myLongestLine) {
            myLongestLine = myLines[i].characters.length;
            myLongestLineGroup = "Line - " + i + "\u000D";
    $.write("The longest lines are: \u000D" + myLongestLineGroup + "With " + myLongestLine + " characters including white spaces and breaks.\u000D");
    If you were after the physical space of a line then another couple of steps would be required. This can be problematic thought especially if the text is not forced to a fixed word, letter and glyph scaling as these paragraph style values can dramatically change the outcome (the default paragraph style has a 80% minimum word spacing by the way so it might cause variations in the result).
    Brett

  • How do I create a new line in a pdf document?

    Hello,
    What I am doing is taking a compilation of information from multiple tables, displaying it in a textarea, allowing a user to change the information that is present in the text area if they wish, and then allowing them to create a pdf file. I am able to do everything except that when the pdf file is created, there is no new like created when the pdf doc is created. I can display multiple lines by using:
    <textarea name="all_content" cols="100" rows="30"><?php
            echo $row_getAllCont['first_name'].' '.$row_getAllCont['last_name']."\n";
            echo $row_getAllCont['email'];
            ?></textarea>
    <?php $_POST['all_content'] = nl2br($_POST['all_content']); ?>
    Then create the pdf doc by using:
    $newpdf = pdf_new();
    pdf_open_file($newpdf, "");
    pdf_set_info($newpdf, "Creator", "Me");
    pdf_set_info($newpdf, "Author", "Me");
    pdf_set_info($newpdf, "Title", "Tryal");
    pdf_set_info($newpdf, "Subject", "tryal");
    pdf_begin_page($newpdf, 595, 842);
    $newfont = pdf_findfont($newpdf, "Times-Roman", "host", 0);
    pdf_setfont($newpdf, $newfont, 10);
    pdf_show_xy($newpdf, $_POST['all_content'], 50, 750);
    pdf_end_page($newpdf);
    pdf_close($newpdf);
    $newbuf = pdf_get_buffer($newpdf);
    $newlen = strlen($newbuf);
    header("Content-type: application/pdf");
    header("Content-Length: $newlen");
    header("Content-Disposition: inline; filename=gen06.pdf");
    print $newbuf;
    pdf_delete($newpdf);
    ?>
    The problem is, when I want to display the first name and last name, and then email in the pdf, I want the email to display on another line only if email isn't set to NULL. I can get it to display in a webpage using the nl2br function but that doesn't work in pdf. Any ideas how to make this work?
    Thanks,
    Kelsey

    Hi Robert,
    Welcome!
    I see you are subscribed to our PDF Pack service.
    Check out this FAQ to help get you started!
    Let me know if this helps.
    Looking forward to hearing back from you!
    Kind regards, Stacy

  • How to force print  page breaks (line feeds) in printed documents

    setup:
    Illustrator CS4
    Windows 7
    I've created a longish document of various pieces of text in 2 diffeent fonts.  No graphics.
    Can I insert linefeeds into the document where I want page breaks when it is printed? If so, what is the technique.
    I come from linux/unix background where one can insert a Ctrl+L (line feed) to cause the printer to start a new page
    at that point.
    I got many hits on a search of this forum on `line feed' but those I browsed didn't really get to the question I'm asking.
    Its a little confusing too because it appears from some of the hits that a line feed is different on windows and even does
    something different.
    Or if that isn't the right approach, how can I make the long document print out in some sensible way?
    I'm using a common inkjet printer (epson R800)

    Can I insert linefeeds into the documentwhere I want page breaks when it is printed? If so, what is the technique.
    This is why I mentioned art boards. A new line or line feed is created when you hit the enter or return key. (I mention both keys as i do not know whether you have a mac or PC though I am leaning to pc since you mention linux/unix.
    You should find the folowing link will tell you everything you need to know about artboards.
    http://help.adobe.com/en_US/Illustrator/14.0/WS0939CFEE-49EF-4c6f-B337-8897EC89DF89.html

  • I am missing some appleworks abilities I do not find on pages.  How does one "draw" vertical lines in a word processing document?

    How do I "draw" a vertical line on PAGES word processing document?

    Why not ask in the Pages forum.
    Update

  • Append table with multi-line cells to word report

    Hi,
    I am using LabView 7.0. I need to append table to word report and I am using Append Table to Report VI. My VI works fine as long as the table cells do not have multiple lines. For multiple lines, each line is put is a seperate cell in the word report.
    Is there a way to append multi-line cells to Word Report??? If not, any suggestions on how I can copy the multi-line table to Word report???
    Please kindly help!!
    Please see the attached document for details on the problem.
    Thanks,
    Mim
    Attachments:
    Table with multiple line cells.doc ‏33 KB

    Hi Mim,
    Yes I understood the multiple-lines part. I think the doc is the report you want. Correct ?
    The doc is generated with your VI without any modifications.
    I am using XP, Office 2002 SP3 and LV7.1
    Attachments:
    Verification Report.doc ‏39 KB

  • How to get string (specified by line and column) from txt file with labview

    Hi everyone
    How to get string (specified by line and column) from txt file with labview
    thx 
    Solved!
    Go to Solution.

    As far as I know, a text file has no columns.  Please be more specific.  Do you mean something like the 5th word on line 4, where words are separated by a space, and lines are separated by a newline character?  You could the Read from Spreadsheet String function and set the delimiter to a space.  This will produce a 2D array of strings.  Then use index array and give the line number and column number.
    - tbob
    Inventor of the WORM Global

  • ASK - How to delete line space in Word document using oracle form

    Hi,
    I have 1 template word document.
    Inside the word document template :
    abcdefg
    [START_TERMS]
    [END_TERMS]
    bbbbbbbbbbbbbbbb
    currently, my program only can delete the statement [START_TERMS] and [END_TERMS].
    so the result
    abcdefg
    ----> space area
    ----> space area
    bbbbbbbbbbbbbbbb
    My expected result is
    abcdefg
    bbbbbbbbbbbbbbbb
    How to replace that two space area in oracle form ?
    Please advise.
    Thanks for your help.
    regards,
    Iwan

    Hi
    Here my code :
    Function DeleteWord(MyOwnSelection OLE2.OBJ_TYPE, MyWord VARCHAR2) Return Boolean Is
    MyArgs OLE2.LIST_TYPE;
    vReturn boolean;
    Begin
    vReturn := FindWord(MyOwnSelection , MyWord);
    -- Can't Find The word
    if vReturn = False Then
         Return False;
    End if;
    OLE2.INVOKE(MyOwnSelection, 'Delete');
    MyArgs := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(MyArgs, '0');
    OLE2.ADD_ARG(MyArgs, '0');
    OLE2.INVOKE(MyOwnSelection, 'SetRange', MyARgs);
    OLE2.DESTROY_ARGLIST(MyArgs);
    Return True;
    End;
    returnValue := WordFunction.DeleteWord(MySelection, '[START_TERMS]');
    Thanks and regards,
    Iwan
    Edited by: user1888509 on Jun 7, 2011 10:34 PM

  • How can I add a red line below all those words, which are not technically correct? And how can I do Pages to do it automatically?

    So, how can I add the red line below all those words, which are not technically correct.
    I have tried everything, but nothing works. Red line should come there automatically, but I can't find nothing from settings to do this. Can you guys help me?

    There isn't any finnish spellcheck in Pages
    Inspector palette = Asetukset
    I am trying to find out where to get a finnish dictionary that can work in Pages. I am not sure but try this
    http://www.jkwchui.com/2010/03/spellchecking-latex-in-macosx/

  • How to replace a line ina text file using java?

    Hi ALL,
    Does anybody know how to replace a line in a text file uisng java.

    use this thing:
    http://doesthatevencompile.com/current-projects/code-sniplets/ASCIIFile.htm
    open the file,
    read its contents, replace the text you need in the contents, set the contents back into the file.
    it takes care of the IO for you.

  • Terminal - how to jump type to the start/end of a word or line?

    How do I jump to the start or end of a word or line in Terminal?
    In other OS X apps, Cmd or Opt + left/right arrows move to the start/end of a line or word respectively.

    Try these (note: the first two require the shift key, at least for me):
    ctrl-A beginning of line
    ctrl-E end of line
    (note: the next two require that you have the Terminal preferences, "settings" , "keyboard" opened, and the checkbox for "Use option as meta key" checked)
    opt-f forward word
    opt-b backward word
    ctrl-u clears the line before the cursor position. If you are at the end of the line, clears the entire line.
    ctrl-f forward character
    ctrl-b backward character
    ctrl-d delete character
    ctrl-l clear screen
    pageup page up in buffer
    pagedwn page down in buffer
    More here:
    http://osxdaily.com/2006/12/19/command-line-keyboard-shortcuts-for-mac-os-x/

  • How to replace a line in file Java

    Hi,
    I want to replace a line in file sequencial.
    I read file, but i don't know how to replace one line..
    Thanks...

    I supose this..
    I usea a FileReader and BufferedReader to read a file.
    I read a line, I know the number of the line, but how to say to method println o write what it's the line to replace?

  • In the new iOS-7 Safari, has the "reader" function been changed to eliminate the option to modify font size (and hence to modify the number of words per line), or is it just that I can't find how to do that?

    In the new iOS-7 Safari, has the "reader" function been changed to eliminate the option to modify font size (and hence to modify the number of words per line), or is it just that I can't find how to do that?

    iOS 7
    Seperate text size modification is no longer available in Safari Reafer.
    Use Settings.
    Settings >General > Text Size

  • How to Replace Line feed

    Hi All,
            i want to replace a line feed which is shown as ## in debug mode with space..
    Though i have tried replacing it by giving hexadecimal value of # but still its not gettign replaced.
    So how do i replace these occurences of line feed in the string which i am using..
    Regards,
    Syed

    Hi try this way :
    data: value type string....
    data: lv_feed type c value CL_ABAP_CHAR_UTILITIES=>CR_LF.
    replace all occurrences of lv_feed in value with space.

Maybe you are looking for