Appending to a word document hyperlink text

Hey, Is it possible to change the hyperlink text not the address? I would like to append to it not completely replace it. This is my example. I would like the hyperlink to display "Fig 1" instead of just the number "1". Is this
possible somehow? thanks.

Hi Rundownbassman92,
This script below may be helpful for you to edit the text of hyperlink in a Word Document:
$word = New-Object -ComObject word.application
$document = $word.documents.open("word file path")
$hyperlinks = @($document.Hyperlinks)
$hyperlinks | ForEach {
$newtext ="Fig "+ $_.TextToDisplay # add "Fig" before original text
$_.TextToDisplay=$newtext
$document.save()
$word.quit()
Best Regards,
Anna Wang

Similar Messages

  • Appending to a Word document

    Two items:
    1) Is there a way to append to an already existing Word
    document? I can create the Word document through AW and it updates
    when then program runs, but if the file has been created outside of
    AW, then the .doc does not get updated.
    2) Rather than appending to the end of a Word document, is
    there a way to append to the top or at least designate where the
    next appended text should be written?
    Thanks!

    Authorware's AppendExtFile function will (should?) append
    text to any document you reference. I'm surprised the Word doc does
    not get updated at all.
    However, I could certainly see the document not being updated
    properly (and maybe that's just what you're seeing). The
    Write/Append functions just write plain old ASCII text. Word is not
    just plain old ASCII text. After appending, open the Word document
    in notepad to see all the other, um, garbage Word adds to the
    document. I would bet the text your appending is indeed at the
    bottom, but its below Word's formatting text so you can't actually
    see it...?
    So, in essence, appending text to an actual Word doc probably
    won't work. I'm not sure how to overcome that... Are these docs
    that others will create? If not, you could try to make them in
    WordPad, perhaps, and see if Authorware will update them. But once
    opened and saved in Word, you're back to where you started.
    There was a discussion here or the List that mentioned an
    ActiveX-like control that could possibly do this. Search?
    To append to the top of a block of text, you have to read it
    in to a variable, add the contents to the top, then write it all
    out to a new document.
    Oh, also for both issues, look at the FileIO Xtra (select
    'Xtra fileio' in the Functions category drop-down). Using this may
    give you a solution - at least to appending at the top. Not sure
    it'll work with Word, considering the hidden garbage in there....
    Erik

  • How to convert a Word document to text or html in an ABAP program

    Hi,
    At my client's site, for the recruitment system, they have the word processing system set to RTF, instead of SAP Script. This means that all the correspondence is in Word format. A standard SAP program takes the word letter, loads word, does the mail merge with the applicant's info and then sends the document to a printer.
    The program name is RPAPRT05. The program creates a document proxy (interface I_OI_DOCUMENT_PROXY) and manipulates the document using the methods of the interface.
    Now what we want to do is to instead of sending the document to a printer, we want to email the document contents to the applicant. But I don't know how to get the content from the Word document into text or html format so that I can make an email from it.
    I know I can send an email with the word document as an attachment, but we'd prefer not to do that.
    I would appreciate any help very much.
    Thanks

    Ok, here's what I ended up doing:
    First of, in order to call FM 'CONVERT_RTF_TO_ITF' you need the RTF document in a table with line length 156. The document is returned from FM 'DP_CREATE_URL' in a table with line length 132. So first I convert the table:
        Transform data table from 132 character lines to
        256 character lines
          LOOP AT data_table INTO dataline.
            IF newrow = 'X'.
            Add row to new table
              APPEND INITIAL LINE TO xdatatab ASSIGNING .
              newrow = space.
            ENDIF.
          Convert the raw line of old table to characters
            ASSIGN dataline TO .
          Check line lengths to determine how to add the
          next line of old table
            newlinelen = STRLEN( newline ).
            ADD addspaces TO newlinelen.
            linepos = linemax - newlinelen.
            IF linepos > datalen.
            Enough space available in new table line for all of old table line
              newline+newlinelen = oldline.
              oldlinelen = STRLEN( oldline ).
              addspaces = datalen - oldlinelen.
              CONTINUE.
            ELSE.
            Fill up new table line
              newline+newlinelen(linepos) = oldline(linepos).
              ASSIGN newline TO .
              newrow = 'X'.
            Save the remainder of old table to the new table line
              IF linepos < datalen.
                oldlinelen = STRLEN( oldline ).
                addspaces = datalen - oldlinelen.
                CLEAR newline.
                newline = oldline+linepos.
              ELSE.
                CLEAR newline.
              ENDIF.
            ENDIF.
          ENDLOOP.
        Write the last line to the table
          IF newrow = 'X'.
            APPEND INITIAL LINE TO xdatatab ASSIGNING .
    Next I call FM 'CONVERT_RTF_TO_ITF' to get the document in SAPScript format:
        Convert the RTF format to SAPScript
          CALL FUNCTION 'CONVERT_RTF_TO_ITF'
            EXPORTING
              header            = dochead
              x_datatab         = xdatatab
              x_size            = xsize
            IMPORTING
              with_tab_e        = withtab
            TABLES
              itf_lines         = itf_table
            EXCEPTIONS
              invalid_tabletype = 1
              missing_size      = 2
              OTHERS            = 4.
    This returns the document still containing the mail merge fields which needs to be filled in:
          LOOP AT itf_table INTO itf_line.
            WHILE itf_line CS '«'.
              startpos = sy-fdpos + 1.
              IF itf_line CS '»'.
                tokenlength = sy-fdpos - startpos.
              ENDIF.
              token = itf_line+startpos(tokenlength).
              REPLACE '_' IN token WITH '-'.
              ASSIGN (token) TO .
              ENDIF.
              MODIFY itf_table FROM itf_line.
            ENDWHILE.
          ENDLOOP.
    And finally I use FM 'CONVERT_ITF_TO_ASCII' to convert the SAPScript to text. I set the line lengths to 60, since that's a good length to format emails to.
        Convert document to 60 char wide ascii document for emailing
          CALL FUNCTION 'CONVERT_ITF_TO_ASCII'
            EXPORTING
              formatwidth       = 60
            IMPORTING
              c_datatab         = asciidoctab
              x_size            = documentsize
            TABLES
              itf_lines         = itf_table
            EXCEPTIONS
              invalid_tabletype = 1
              OTHERS            = 2.
    And then the text document gets passed to FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' as the email body.

  • How to copy paste a table structure from word document into Text Field [field format Rich Text]

    In our current implementation we have a Blank page with Text Field [field format Rich Text] on generated PDF Document.
    Once the PDF document is generated, user can copy paste content form any word/rtf document to into the Text Field.
    Pasted content retains all text formatting [Bold, Italic, Underline, Indentation] except the Table format. Text Field is removing table metadata from the content and converting it into plant text.
    Is there anyway to copy paste table structure as it is from word document into Text Field?

    Hi,
    I don't think you can! While you can paste formatted text into the rich text field, the table metadata means nothing to the textfield.
    Niall

  • Word document hyperlinks no longer valid

    I have 100+ Word documents waiting to load into Portal, many of which contain internal (relative path) hyperlinks to each other
    For example:
    .../Lethal Weapon/
    JKs Overview.doc
    .../Lethal Weapon/Movie I/
    Review 001.doc
    Review 002.doc
    Now, the overview has links to each review, and each review has links back to the overview etc. - get the picture?
    The documents load OK, but the document names are changed to cater for undesirable spaces (i.e. map to underscore or %20). When navigating to one of the referenced documents I encounter trouble due to the document name mangling mentioned previously
    I cannot change the document naming convention and want to maintain the integrity of the links automatically. I have thought about manual effort and developing tools etc. for the process but believe that this problem should be handled within Portal itself somehow
    Does anyone have a seamless solution?
    Thanks, any advice appreciated
    null

    Try posting this to the Oracle Portal forum - this forum is for developers creating providers using the PDK

  • How to cut and paste long Word document into text generator?

    I have a very long list of attributions in a Word document.
    When I cut and paste it into the "Sample Text" area, it goes in fine.
    But when I try to look at it ... either as simple text or, preferred, scrolling ... I only get parts of the document.
    I can correct it by adding a 'return' in the middle of every few words.
    But my document is so long, it would take a long time to do that one by one.
    Solutions sought: How to just import the whole document and have it scroll, zip-zip?!

    Thank you DH and skalaki, I had not known of the Boris title generator. Funny, I had looked in the FCE online manual until 'titling' and editing text ... didn't see mention of that.
    In any case ... I've now found it and trust I'll be able to figure it out.
    Since skalaki was first with the answer, I awarded the 'solved' there. DH's comments were further helpful.

  • Old word document is text mess when open them in word 2012 ?

    Hi there 
    I have a lot of old word document (they created by word 2003 & 2007 and 2010 ) and i need to edit them in word 2012 but when I open them in word 2012 there text are mess and mixed .
    i installed my language pack ( persian ) on word 2012 but not effective 
    please help me how can I fix them and how to edit old word document in word 2012 ?
    I really need you're help to fix it and Edit mu files 
    so help
    Whit the best ragard :
    Raha

    Before we go any further, I would like to say that there is no Word 2012 version released before for Microsoft official site.
    If the Word document could still be opened by other machine except for Word 20XX in the
    specific machine, that means the data file itself is fine. But Word 20XX application mighe be corrupted. Repair it and then check the result.
    Tony Chen
    TechNet Community Support

  • How to Append two  word documents into single  using   java

    How to Append two word documents into single using java
    we tried this but it's not append the one word document to other
    source code:public class AppendTwoWordFiles {
         public static void main(String []arg)throws IOException
              FileInputStream fi=null;
              FileOutputStream fo=null;
              try {
                   System.out.println("Enter the source file name u want to append");
                   BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                   File f1=new File(br.readLine().toString());
                   System.out.println("Enter the Destination file name ");
                   File f2=new File(br.readLine().toString());
                   fi = new FileInputStream(f1);
                   fo = new FileOutputStream(f2,true);
                   byte b[]=new byte[2];
                   while((fi.read(b))!=-1);
              fo.write(b);
    System.out.println("Successfully append the file");
              } catch (FileNotFoundException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              finally{
              fi.close();
              fo.close();
    plz reply me quickly ,,,what can i follow

    Use this code ..
    and give the path of the both file like this.....
    source file ---- C:/workspace/Practice/src/com/moksha/ws/test/practice.text
    destination file ---- C:/workspace/City/src/com/moksha/ws/test/practice1.text
    import java.io.*;
    public class AppendTwoWordFiles {
         public static void main(String[] arg) throws IOException {
              FileInputStream fi = null;
              FileOutputStream fo = null;
              try {
                   System.out.println("Enter the source file name u want to append");
                   BufferedReader br = new BufferedReader(new InputStreamReader(
                             System.in));
                   File f1 = new File(br.readLine().toString());
                   System.out.println("Enter the Destination file name ");
                   File f2 = new File(br.readLine().toString());
                   fi = new FileInputStream(f1);
                   fo = new FileOutputStream(f2, true);
                   byte b[] = new byte[2];
                   int len = 0;
                   while ((len = fi.read(b)) > 0) {
                        fo.write(b, 0, len);
                   System.out.println("Successfully append the file");
              } catch (FileNotFoundException e) {
                   e.printStackTrace();
              } catch (IOException e) {
                   e.printStackTrace();
              } finally {
                   fi.close();
                   fo.close();
    }

  • Standard text in Routings - Word documents

    Hi all
    I want to attach word documents to Standard Routers. I checked the standard text CA10 but did not find a way to upload word documents. I saw an option only for uploading 'ASCII', RTF or RTF files. Is there a way I can attach word documents to the Routings. What is the best way to do it? Is it standard text or some other process.
    Am using ECC 6.0
    thanks

    Dear,
    you cannot attach,....but you can copy from word document to text click on long text and copy the word document data to the long text page and save

  • How to convert a Word Document to SAP SCript standard text.

    Hi team,
    Does any one know how to convert a word document or text in Word format to standard text.
    So that we can use that standard text in Script output.
    This might be very useful if we need to convert a lot of text into standard text.

    Hi,
    Create the name of the standard text you want in SO10.
    When the editor is called up, select Text -> Upload and then browse for your file(s). Must be saved in RTF format in Word remember.
    Cheers
    Colin.

  • How do you hook a MS Word document to a page in my Site?

    Hello there,
    I have several documents in MS Word that I would like visitors to be able to read them.
    How to link the documents, do they have to be in a certain place (ie data base) to be referenced?
    Thank you very much in advance.

    You can embed the Word document (also text, PDF and HTML documents) into an iWeb page with an iFrame code and an HTML snippet like in this demo page: Scrolling Text Box. The Word document is at the bottom.
    OT

  • Formatting Word document(*.docx) containing pictures, tables, charts, etc.

    I've converted a PDF file to Word format(*.docx) successfully. However, as soon as I modify text in the Word document, it has an adverse formatting effect with pictures, charts, tables, etc, in the Word document - the text side of things works perfectly.
    CAN YOU HELP?

    Hi mancity55,
    Would you send your PDF document to [email protected] as an email attachment? 
    I will check it from my end.Please add the link to this forum post for reference.
    Regards,
    Florence

  • Delete a Page in Word Document

    I want to run a macro to delete the 3rd (and it is also the last) page of a document.  I've found the following code in the forum:
    Selection.HomeKey wdStory
    Selection.Goto What:=wdGoToPage, Count:=3
    Selection.Bookmarks("\Page").Select
    Selection.Delete
    However, when the macro hits the first line, it gets a run-time error 438 Object doesn't support this property or method.
    Interestingly, others responded that this code worked fine. 
    What am I missing?
    Thanks,
    AGI_MEG

    Where is the cursor when you run the macro?
    The problem when attempting to delete 'pages' in a Word document is that Word is not a page layout application. There are no 'pages' in a Word document, only text flowed into a document container which comprises a variety of story ranges. When attempting
    to delete a 'page' it helps to know what is on that 'page'.
    However if you want to delete the last 'page' of a document, then the following may work for you. Ensure the cursor is in the body text of the document.
    Sub Delete LastPage()
    Dim PageCount As Long
    Dim orng As Range
        Selection.EndKey wdStory
        PageCount = Selection.Information(wdActiveEndPageNumber)
        Selection.GoTo What:=wdGoToPage, Count:=PageCount
        Set orng = Selection.Bookmarks("\Page").Range
        orng.End = orng.End + 1 'ensures no empty page at the end after removal.
        orng.Delete
    End Sub
    Graham Mayor - Word MVP
    www.gmayor.com

  • It used to be that when I created a pdf from a word or publisher document, hyperlinks worked fine. Now I cannot get them to work unless the text displayed for the link is the complete address and it all appears on one line. Why?

    it used to be that when I created a pdf from a word or publisher document, hyperlinks worked fine. Now I cannot get them to work unless the text displayed for the link is the complete address and it all appears on one line. Why?

    You can print to the Adobe PDF printer, but that only creates links that Acrobat or Reader recognize as such. That is the reason for needing the entire URL on one line. It is not actually an embedded link, but one created by Acrobat on the fly. With OFFICE 2013 you have two choices: 1. create the PDF with the print to Adobe PDF and then add the links in Acrobat so that they are complete or 2. I think the WORD save as PDF or XPS will create the PDF with links, but not sure. If so, that would be the quickest solution for you, but be aware of potential problems with the MS plugin.
    Of course, the third option is to upgrade to XI which can be done with AA 9. You will probably not be eligible for a for an upgrade to whatever the next version will be.

  • Word import - hyperlinks work in one document, not in another

    Hi all,
    I am aware that much has been written about broken links after importing, but there is a strange pattern to my problem I have not seen before.
    I have three language versions of one document (English, French, German). So I set up three independent RoboHelp 8 projects and imported (linked) the corresponding Word documents. English and German are no problem, but in the French project, some (10%) cross-refs are not converted to hyperlinks. The involved titles have no accents, so it is probably not a character set problem. If I update the Word link or force update, it is always exactly the same cross-refs that are not converted correctly.
    The cross-refs in Word look like this:
    {HYPERLINK \I " title "}
    The cross-refs that do convert correctly have the same format, I see no difference between cross-references that work in RH and those that don't.
    Any ideas about this?

    Sometimes, but it does not seem to affect the function. There are working links with spaces at the end.
    On the other hand, there are strange things like this:
    I have two chapter titles named "Système de désignation des modules de fonction" and"Système de désignation des connexions".
    When I create hyperlinks, then Word inserts these fields:
    {HYPERLINK \l " Système de désignation"}
    {HYPERLINK \l " Système de désignation "}
    -> The titles are cut off in the middle, the text markers differ only by an extra space. These hyperlinks work in Word, but not in RoboHelp.

Maybe you are looking for

  • Issue with Applications, file paths, mobile accounts in snow Leopard OD

    Hello Everyone, The Facts: 2 x Xserves running Snow Leopard 10.6.2 Server (1 is a Open Directory Master, the other a backup/slave) About 20 end-users running 10.5.8 Leopard and 10 end-users running 10.6.2 Snow Leopard on MacBook Pro laptops. All lapt

  • My ipod touch 5 is stuck in recovery mode

    ive tried every thing on youtube except dowloading softwares bc im 12 years old and i have an ipod touch 5 and an ipad mini i am very happy with the apple companys service but i dont like getting stuck at a dead end

  • Export image EMF from tab control, help!!

    Hello, I am trying to get a good resolution report. I got use export image to EMF file so the graphs look very good resolution. When I appended the image control like png it looked poor quality. Now is ok, now I export image of graphs to emf and then

  • How do I import a SPSS .sav file into SQL 2008 r2 using SSIS

    Hi there, Like the title says, I'm trying to import an SPSS .SAV file into an SQL 2008 R2 database using SSIS. I've tried a few things, but i cant seem to get it to work properly. I'm hoping there's someone out there who could point me in the right d

  • ViewObjectImpl createRowSetIterator not returning rows?

    Hi, I hope somebody can help with the following question please? I have the following code in one of my ViewObjectImpl classes: public String findGender(String titleId) {   RowSetIterator rsi = this.createRowSetIterator("myIterator");   Key key = new