Insert html into styled document

Hi,
I would like to insert html content into a JEditorPane that uses a StyledDocument and DefaultStyledEditorKit. I do not want to use the HtmlEditorKit for some reasons though that might change later. Now, I want to insert ElementSpec objects into my styled document and the only way seems to be doc.insert(o, espec) where espec is of type ElementSpec[]. I would like to insert my ElementSpecs one by one if possible.
Can someone tell me how I can do this.
Cheers,
Omprakash.V

Hi,
I was referring to DefaultEditorKit in the above post when I said DefaultStyledEditorKit.
Cheers,
Omprakash.V

Similar Messages

  • Inserting HTML into JTextPane

    Hi,
    I am trying to insert HTML into JTextPane.
    I am using the following code for the same.
    JTextPane jedit = new JTextPane();       
    jedit.setContentType("text/html");
            HTMLDocument doc = (HTMLDocument)jedit.getDocument();
            String text = "<a href=\"???\">hyperlink</a>asd<a href=\"???\">hyperlink123</a>";
            HTMLEditorKit editorKit = (HTMLEditorKit)jedit.getEditorKit();
            editorKit.insertHTML(doc, doc.getLength(), text, 0, 0, null);
            doc.insertString(doc.getLength(),"Hi testing",null);
            text = "<a href=\"???\">hyperlink123</a>";The problem is that the HTML gets inserted into new line. I do not want the new line.
    I know there is an API like insertBeforeEnd(...) but do not know how to use that.
    Any help for the above problem will be of great use.
    Thanks.

    look I have got the answer ... I guess this would be the root cause of the problem of new line.
    when ever you want the text to be inserted
    -at new line provide the last argument  of HTMLDocument.insertHTML as null
    - at same line provide the last argument as the HTML tag you are inserting into the JtextPane's document.thats it !!!
    ENJOY :-)

  • Inserting jpegs into word2010 documents

    I have just been through a long seige with Microsoft TS (which cost me 39 bucks) about the fact that I cannot import  images into a word 2010 document. They comes in as  black rectangles.  I can import images from my HP scanner, from the WEB, from screenshots, etc, but any images that was formatted in Lightroom or Nikon NX come in as a black rectangles.  That includes JPG and TIFF.  The only suggestion I could get from Microsoft was that I should be using software other than Adobe.   The other weird thing is that word2010 works properly on my laptop.  Both machines are Dell W7, 64bit.

    I normally import images from NEF to DNG to a Lightroom catalog on my photoarchive on an external HD.  Once I have finished processing and organizing them, I export selected images as JPG at appropriate sizes to appropriate directories on the internal HD on my computer.   I no longer do many newsletter publication type things, but I just tried one in which I typed a body of text with word2010 (just installed, and working fine for most other things).  However, when I tried to use Word's "insert>picture" capability, referenced to the appropriate JPG image file on the HD, the low resolution JPG images come in as black rectangles, no matter what the image size.  I fought it for several days--once in a while the image would come in properly, and immediately turn black.  The extra weird thing is that Word2010 works fine on my laptop.  I can import the same JPG images over my (wired) network from my desktop to the document on the laptop, no problem, but if I then send the resulting properly-formatted document from the laptop back to the desktop, the images will turn black when they hit the desktop.  The only way I can do the illustrated newsletter thingy is to write it to Acrobat and send it to the desktop for printing, or just print it from the laptop.   Both desktop and laptop are running W7ultimate and are 64 bit machines.  As I think I mentioned in the post, everything works fine with jpgs that from screenshots or JPEG scans from my HP multifunction printer, so long as the scan was never imported to a Lightroom catalog, OR Nikon NX.
    Date: Fri, 16 Jul 2010 12:33:48 -0600
    From: [email protected]
    To: [email protected]
    Subject: inserting jpegs into word2010 documents
    Have you exported the image from Lightroom to a JPG file on your hard disk?
    Exactly what steps do you follow to get the image out of LR and into Word?
    >

  • Javascript code missing when inserting Fireworks html into DW document

    I tried to insert fireworks html in a Dreamweaver file. After importing the fireworks html in the Dreamweaver document, the associated Javascript code was missing.
    Of course, the Fireworks html file includes the Javascript code and works properly. It is just that when I insert the Fireworks html into the Dreamweaver file, the associated Javascript code gets lost although the manual clearly says that fireworks html is inserted "along with its associated images, slices, and JavaScript".
    I use Fireworks CS5 and Dreamweaver CS5, but I also tried it using FW CS4 and DW CS4 which did not solve the problem.
    I tried two ways to insert the html code (both with the same negative result):
    1.) using the DW menu: Insert > Image Objects > Fireworks HTML
    2.) Copying the HTML to the clipboard in Fireworks, and then pasting it into the Dreamweaver document
    The Fireworks and the Dreaweaver files are both HTML4 docs.
    Of course, I could insert the Javascript code manually, but then I would have to detach the associated template from the DW doc, and I would rather not do that because then later updates to the site will become more complicated.
    BTW, I also tried to insert the fireworks html in another Dreamweaver document not using any template, but the JavaScript code got lost though.
    I would be very grateful if somebody had an idea how to solve this  problem.
    Many thanks for your help!
    Siria
    Message was edited by: SiriaW

    Dear Murray,
    I believe you can solve your problem by changing this -
    </head>
    to this -
    <!-- #BeginEditable "head" --><!-- #EndEditable -->
    </head>
    by editing this template directly.
    I tried this, but it did not change anything. As I wrote before, the JavaScript code is not even inserted when I use a "blank", not-template-controlled DW page.
    But nevertheless, your hint is very helpful. By making the complete head editable, I can at least insert the Javascript code manually.
    But is the javascript that is currently shown there part of the FW HTML insertion?  Do you want to preserve that on the child pages?
    It belongs to the template. And yes, I want to preserve it on the child pages. I just want to insert this into the head of the child page:
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    Maybe we should see the FW code you are trying to insert?
    Sure. Here is the code I tried to insert (of course, most of the Java Script does not need to be inserted as it is already in the template):
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <!-- saved from url=(0014)about:internet -->
    <html>
    <head>
    <title>example.jpg</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <!--Fireworks CS5 Dreamweaver CS5 target.  Created Wed Jul 21 00:26:08 GMT+0800 (Malay Peninsula Standard Time) 2010-->
    <script language="JavaScript">
    <!--
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    function MM_nbGroup(event, grpName) { //v6.0
    var i,img,nbArr,args=MM_nbGroup.arguments;
      if (event == "init" && args.length > 2) {
        if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
          img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
          if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
          nbArr[nbArr.length] = img;
          for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
            if (!img.MM_up) img.MM_up = img.src;
            img.src = img.MM_dn = args[i+1];
            nbArr[nbArr.length] = img;
      } else if (event == "over") {
        document.MM_nbOver = nbArr = new Array();
        for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
          if (!img.MM_up) img.MM_up = img.src;
          img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?args[i+1] : img.MM_up);
          nbArr[nbArr.length] = img;
      } else if (event == "out" ) {
        for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
      } else if (event == "down") {
        nbArr = document[grpName];
        if (nbArr) for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
        document[grpName] = nbArr = new Array();
        for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
          if (!img.MM_up) img.MM_up = img.src;
          img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
          nbArr[nbArr.length] = img;
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    //-->
    </script>
    </head>
    <body bgcolor="#ffffff" onLoad="MM_preloadImages('example_bilder/example_r2_c2_s2.jpg','example_bilder/example_r2 _c2_s3.jpg','example_bilder/example_r1_c4_s1.jpg','example_bilder/example_r4_c2_s2.jpg','e xample_bilder/example_r4_c2_s3.jpg','example_bilder/example_r1_c4_s2.jpg','example_bilder/ example_r6_c2_s2.jpg','example_bilder/example_r6_c2_s3.jpg','example_bilder/example_r1_c4_ s3.jpg','example_bilder/example_r8_c2_s2.jpg','example_bilder/example_r8_c2_s3.jpg','examp le_bilder/example_r1_c4_s4.jpg','example_bilder/example_r10_c2_s2.jpg','example_bilder/exa mple_r10_c2_s3.jpg','example_bilder/example_r1_c4_s5.jpg');">
    <table style="display: inline-table;" border="0" cellpadding="0" cellspacing="0" width="915">
    <!-- fwtable fwsrc="lebenslauf_inhalt_slices_optimiert.png" fwpage="Page 1" fwbase="example.jpg" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="1" -->
      <tr>
       <td><img name="example_r1_c1_s1" src="example_bilder/example_r1_c1_s1.jpg" width="58" height="274" border="0" alt=""></td>
       <td><table style="display: inline-table;" align=""left" border="0" cellpadding="0" cellspacing="0" width="195">
          <tr>
           <td><img name="example_r1_c2_s1" src="example_bilder/example_r1_c2_s1.jpg" width="195" height="68" border="0" alt=""></td>
          </tr>
          <tr>
           <td><a href="javascript:;" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','example_r2_c2_s1','example_bilder/example_r2_c2_s2.jpg',' example_bilder/example_r2_c2_s3.jpg',1);" onClick="MM_nbGroup('down','navbar1','example_r2_c2_s1','example_bilder/example_r2_c2_s3. jpg',1);MM_swapImage('example_r1_c4_s1','','example_bilder/example_r1_c4_s1.jpg',1);"><img name="example_r2_c2_s1" src="example_bilder/example_r2_c2_s1.jpg" width="195" height="16" border="0" alt=""></a></td>
          </tr>
          <tr>
           <td><img name="example_r3_c2_s1" src="example_bilder/example_r3_c2_s1.jpg" width="195" height="14" border="0" alt=""></td>
          </tr>
          <tr>
           <td><a href="javascript:;" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','example_r4_c2_s1','example_bilder/example_r4_c2_s2.jpg',' example_bilder/example_r4_c2_s3.jpg',1);" onClick="MM_nbGroup('down','navbar1','example_r4_c2_s1','example_bilder/example_r4_c2_s3. jpg',1);MM_swapImage('example_r1_c4_s1','','example_bilder/example_r1_c4_s2.jpg',1);"><img name="example_r4_c2_s1" src="example_bilder/example_r4_c2_s1.jpg" width="195" height="16" border="0" alt=""></a></td>
          </tr>
          <tr>
           <td><img name="example_r5_c2_s1" src="example_bilder/example_r5_c2_s1.jpg" width="195" height="15" border="0" alt=""></td>
          </tr>
          <tr>
           <td><a href="javascript:;" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','example_r6_c2_s1','example_bilder/example_r6_c2_s2.jpg',' example_bilder/example_r6_c2_s3.jpg',1);" onClick="MM_nbGroup('down','navbar1','example_r6_c2_s1','example_bilder/example_r6_c2_s3. jpg',1);MM_swapImage('example_r1_c4_s1','','example_bilder/example_r1_c4_s3.jpg',1);"><img name="example_r6_c2_s1" src="example_bilder/example_r6_c2_s1.jpg" width="195" height="17" border="0" alt=""></a></td>
          </tr>
          <tr>
           <td><img name="example_r7_c2_s1" src="example_bilder/example_r7_c2_s1.jpg" width="195" height="14" border="0" alt=""></td>
          </tr>
          <tr>
           <td><a href="javascript:;" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','example_r8_c2_s1','example_bilder/example_r8_c2_s2.jpg',' example_bilder/example_r8_c2_s3.jpg',1);" onClick="MM_nbGroup('down','navbar1','example_r8_c2_s1','example_bilder/example_r8_c2_s3. jpg',1);MM_swapImage('example_r1_c4_s1','','example_bilder/example_r1_c4_s4.jpg',1);"><img name="example_r8_c2_s1" src="example_bilder/example_r8_c2_s1.jpg" width="195" height="16" border="0" alt=""></a></td>
          </tr>
          <tr>
           <td><img name="example_r9_c2_s1" src="example_bilder/example_r9_c2_s1.jpg" width="195" height="15" border="0" alt=""></td>
          </tr>
          <tr>
           <td><a href="javascript:;" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','example_r10_c2_s1','example_bilder/example_r10_c2_s2.jpg' ,'example_bilder/example_r10_c2_s3.jpg',1);" onClick="MM_nbGroup('down','navbar1','example_r10_c2_s1','example_bilder/example_r10_c2_s 3.jpg',1);MM_swapImage('example_r1_c4_s1','','example_bilder/example_r1_c4_s5.jpg',1);"><i mg name="example_r10_c2_s1" src="example_bilder/example_r10_c2_s1.jpg" width="195" height="16" border="0" alt=""></a></td>
          </tr>
          <tr>
           <td><img name="example_r11_c2_s1" src="example_bilder/example_r11_c2_s1.jpg" width="195" height="67" border="0" alt=""></td>
          </tr>
        </table></td>
       <td><img name="example_r1_c3_s1" src="example_bilder/example_r1_c3_s1.jpg" width="69" height="274" border="0" alt=""></td>
       <td><img name="example_r1_c4_s1" src="example_bilder/example_r1_c4_s1.jpg" width="539" height="274" border="0" alt=""></td>
       <td><img name="example_r1_c5_s1" src="example_bilder/example_r1_c5_s1.jpg" width="54" height="274" border="0" alt=""></td>
      </tr>
    </table>
    </body>
    </html>

  • Inserting HTML into JEditorPane

    I have a window with a JEditorPane on top and a JTextField below it. I need to be able to type raw HTML into the edit field and have it appended to the HTML document displayed above.
    For example if I type...
    This is <b>bold
    I need to append that to the document. However I want the style to stick. Notice I did not close the tag above. I want the next line I enter into the edit field...
    and so is this but not</b> this.
    I want this to appear bold up until the closing tag and then return to normal. The problem is that every time I append new text to the document the style is restored to normal.
    I insert the text with the following code. I send the contents of the JTextField to the following function when I hit return.
    void processInput(String input) {
    try {
    HTMLDocument doc = (HTMLDocument) output.getDocument(); // output is my JEditorPane
    editor.insertHTML(doc, doc.getLength(), input, 0, 0, HTML.Tag.BODY); // editor is HTMLEditorKit
    // relevant catch clauses
    Basically I want the two broken input sequences to appear in the editor as one seamless entry. I want to be able to type these two entries and have them show up as if they were entered as one entry.
    entry 1:This is <b>bold
    entry 2: and so is this but not</b> this.
    I want to somehow cause this to be displayed as if I typed...
    This is <b>bold and so is this but not</b> this.
    Is there a way I can do this?
    Thanks.
    -Russ

    as i understand you you want to write
    entry 1:This is <b>bold
    entry 2: and so is this but not</b> this.
    in two lines
    Try this
    entry 1:This is <b>bold<br>
    entry 2: and so is this but not</b> this.

  • No longer able to insert filename into a document in the new pages

    Does anyone know if the ability to insert the filename into the document has been eliminated or if we just have to get to it another way? Used to be able to go to INSERT>FILENAME but that seems to have disappeared.
    Thanks
    AJ

    It does cause problems in a number of circumstances.
    In this forum alone, there are several threads with many users who used Setup Assistant or Migration Assistant to transfer their stuff, ended up with lots of duplicate apps because of it, and had great difficulty finding and deleting the duplicates.
    There have also been folks whose apps did't get updated, and Adobe apps that wouldn't run at all.
    Again, it depends on the apps and circumstances.

  • Inserting notes into a document

    When I try to insert a note into a document, the text takes forever to show up and slows down my progress.  Is this normal, is there a way to speed it up so that it types in real time.

    Hello “Rave”?
    Sorry for the later reply, just finishing University exams.  So it is the adobe reader XI version and I do have a paid subscription for it to convert to Word or Excel files.  Blah blah.  The problem is, when I open a document, and want to add a note, for later editing, and yes the little sticky note, it never types out what you are adding in real time.  It will take about 10 minutes before it registers leaving you sitting in nowhere land unable to use the progam in other areas. 
    So what is the trick?  The internet connection is fine, the computer is fine, windows 8, etc etc. 
    Sent from Windows Mail

  • Inserting HTML into a table?

    I am trying to find an easier method of inserting html code into a column of type varchar2. I have to insert 100's of lines of html into a table weekly and the inserts keep failing because of special charecters within the html code itself. I have written scripts using UTL_FILE functions but this is very tedious to do weekly. Is there a better method to accomplish inserting html?

    try this.
    Hi,
    procedure start_import (p_filename in varchar2)
    is
    v_lob clob;
    v_offset number := 1;
    v_file bfile := bfilename('IMPORT',p_filename);
    v_lob_length number;
    begin
    -- File open
    dbms_lob.fileopen(v_file);
    -- get file length
    v_lob_length := dbms_lob.getlength(v_file);
    -- Create temp LOB (CACHED)
    dbms_lob.createtemporary(v_lob,TRUE);
    -- fill Temp Lob with filecontent
    dbms_lob.loadfromfile(v_lob,v_file,v_lob_length);
    -- Close file
    dbms_lob.fileclose(v_file);
    So, now you have the Filecontent in your temp LOB.
    For more info. about LOB, read Oracle Documentation.
    Hope this helps,
    Kalpen
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Troy Johnson ([email protected]):
    I am trying to find an easier method of inserting html code into a column of type varchar2. I have to insert 100's of lines of html into a table weekly and the inserts keep failing because of special charecters within the html code itself. I have written scripts using UTL_FILE functions but this is very tedious to do weekly. Is there a better method to accomplish inserting html?<HR></BLOCKQUOTE>
    null

  • Inserting html into a composition in muse

    Hi, I am trying to insert some html into a composition in Muse.  I would like to have a clickable button trigger, and then a kind of overlay opens up with an interactive calculator inside.  I have the html for the calculator, the problem is no matter how I try to insert it into Muse, the calculator either disappears (as well as the trigger) for some reason, or the calculator stays on the page the entire time, losing the whole clickable effect.
    Can someone tell me the best way to do this?

    Hello,
    Which Composition are you trying to Use ? Blank,Featured News, Lightbox Display, Presentation or Tooltip ?
    Also Make Sure to drag and drop the inserted HTML window over the target (Border of target gets activated once you move it over), Hopefully this will work.
    I created the same using Tooltip composition and its working fine. Please take a look at the link.
    Home
    If it do not work then please share the calculator HTML  code that you are inserting so that I can do some test at my end.
    Regards
    Vivek

  • Insert SWF into new document

    I want ot convert a SWF created in Captivate into an avi. It
    seems that the simplest way is to import it into a Flash doc and
    export as an avi, but I don't know Flash well. I wish I had a day
    to get up to speed on it, but for now, quick, easy instructions are
    what I need. I don't need any controls. I don't have a skin. It's
    essentially an animated card with music that we're sending out to
    some of our trainers to thank them for their help.
    Thanks for any help!!

    Wow, that's some of the more optimistic code I've seen in a while.
    A Word document is a binary file, you cannot simply insert text into the middle of a binary file and expect it to work, that's not how they work unfortunately. You might be able to read an RTF file in, but I don't think they support images.
    Could you use a plain text file as the source and a PDF as the output? That'd be easy. Or even just use CFDocument to create a PDF with the images, then print that. Does it actually need to be Word?

  • Can no longer see my I-photo photos, when trying to insert photo into Word Document.

    I had some computer problems and did upgrade to Snow Leopard from Leopard. Using older MacBook Pro. 
    Now, when I try to insert a picture into a Word Document, I cannot see my photos!
    I am working in a word document, I choose "Insert Photo from my files" and when the window comes up so I can choose the photo to insert... when I select the "photos" choice under the Media section on the Left side of the box that comes up, the box to the right is BLANK, both on the top and bottom!  None of my photos come up for selection. 
    This method to choose photos to insert into documents used to work before... now it is not.  After selecting "photos" all my photos would appear in the right box, and I would move through my I-photo events to choose my saved photo and insert it.  Yes, photos are showing and present in I-photo.  They just won't appear for importing.
    This is so frustrating, not to mention time comsuming trying to figure out what is going on and how to fix it.
    Can anyone help? Please?

    Oroilore-
    I do not see a way to disable the Picture Frame icon.  I looked at Settings-Picture Frame, but none of the options turns it off.  The only way I can thinik of, would be if all of your photos had been deleted.  If there were no photos, you couldn't have a slide show!
    One thing to try is to reset (reboot) your iPad.  Hold both the Home and Sleep buttons for several seconds until the Apple logo appears.  Ignore the "Slide to power off" arrow.  The iPad will restart after a couple of minutes.  Resetting this way will not hurt anything, and sometimes clears up mysterious problems.
    Fred

  • Inserting photo into word document with new Yosemite OS X

    iPhoto has gone away after downloading the new Yosemite OS X program.  Now it is Photos.  I am attempting to drag or insert a picture into a word document for work.  Unlike the old iPhoto, double clicking on the photo does not allow me to "Copy" so I may then "Paste" on my document.  In addition, when I attempt to drag the picture onto the document where I want it, the picture goes right back to the photo library.  Tried pretty much everything I know and my tech guys from work.  Anyone have this problem or know of the solution?

    My photos are not in/on iCloud. In Microsoft Word 2011 I can use
         Insert > Photo > Picture from File ...
    and then navigate to the my 'Pictures' folder and insert a picture successfully.
    Can't find a direct way of going from Photos to Word. In practice, this is not a big issue for me because in most cases I want to reduce the size of the image, which I do by selecting the image(s) I want in Photos.app, then switch to Preview.app, command-N (New from clipboard). Once in Preview.app I can transfer images to Word by drag and drop from the thumbnails, etc. The neat thing about this workflow is one can select several images in Photos at once and have them all open in Preview with one keystroke.
    C.

  • Inserting File into Word Document

    Using Powershell, I'm trying to embed a zip file into a Word Document so that the embedded file is displayed as an icon.
    So far, I have only been able to insert the verbiage of a text file using the following code...
    $objWord = New-Object -comobject Word.Application
    $objWord.Visible = $False
    $objDoc = $objWord.Documents.Open('c:\test\example.doc')
    $selection = $objWord.Selection 
    $objRange = $objDoc.Bookmarks.Item("txtInsertFile").Range
    $objdoc.bookmarks.add("newBookmark",$objRange)
    $bookmark = $objdoc.Bookmarks._NewEnum | ?{$_.Name -eq "newBookmark"}
    $bookmark.Range.InsertFile("C:\test\text.txt")
    Possibly I shouldn't be using InsertFile?  Is there another option?
    Thanks so much for your help!

    Hi LittleMissMagic,
    Since we have not heard from you for a while, I assume that this issue is solved.
    I will mark a reply as an answer, please feel free to unmark it if the reply is not helpful.
    We are looking forward to hearing from you.
    Best Regards,
    Anna

  • Inserting HTML into a web page

    On a previous thread I asked how to insert ones own code into a page created in iWeb.Some kind person told me how to do it,namely: find the html page in iMac on my hard drive,in TextEdit insert the code that I want and click Save.It all worked fine. However when I go back into my web page in iWeb and make a change followed by upload, the code that I inserted in TextEditor is wiped.Is there any way that I can insert my own code into a web page and not get it wiped when I make other changes in iWeb and upload to the server? Thanks in advance

    Nope, this is how it works. If you make a change to a page like this post-publishing, and later re-publish, you have to make the html changes again! Set up a Find/Replace command in MassReplaceIt and you can do this very quickly. You can save your queries so you can make all of your changes with one click the next time you save.
    Download here:
    http://www.hexmonkeysoftware.com

  • 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]

Maybe you are looking for

  • How do I install Adobe Presenter 9 on Windows 8.1 running MS Office 2013 (32 bt)?

    How can I install a trial version of Adobe Pesenter 9 running Windows 8.1 and also running MS Office 2013? I am sure it is 32 bit, so that is not the issue. I can see it in the add-ins in Power Point, but when I check it to run, it will not do anythi

  • Child form editing when approval workflow is triggered in OIM 9i

    Hi All,             I am working with oim 9i.I wanted to know if there is any way to prevent editing of child form once it is submitted for approval.             I have a object form with a child form attached.             I have these forms attached

  • Source record and Trailor record

    Hi All, I have a requirement to validate the source record count with the trailor record count. And pass value futher if matches else abort the load and generate email. I have separated header and footer info in one table and detail record to one tab

  • Executing Instances waiting for pending manual recovery

    Hi, We are using SOA Suite 10.1.3.3.1. As part of error handling design, we have configured the fault policy such that BPEL flows will go to manual recovery in case of PL errors. From BPEL console we can retry/abort these instances. Is it possible to

  • Migration Assistant not recognizing old macbook

    I am trying to transfer my files from my old MacBook Pro (2006) to my new MacBook Pro (mid-2012) using Time Machine Backup. From Migration Assistant, once I get to where it is "looking for other computers" it is not finding anything. I have my old ma