How to retain formatting from Word to RoboHelp?

I'm using Robohelp for Word 8.0.  Thus far, I've done all my work in Word.  The problem I'm having is getting styles to appear in the online help the same way they do in Word. My output file is web help.
When I compile, RoboHelp correctly formats the font type and size for each of the styles I've created.  Also, it usually gets bold text right.  What it won't handle at all is color.  I've tried using Web-friendly RGB values; nada. It's always black.
The other formatting issue I'm having is lists -- bulleted lists and numbered lists.  RoboHelp inserts a lot of space between the bullets/numbers and the beginning of the text.  That space is not in the Word document.
Finally, if I have links in a bulleted list, RoboHelp formats the entire bulleted item -- including the space between the bullets and the text -- with an underline. 
I'm really hoping I won't have to take this into the RoboHelp HTML application.  I'm not very HTML-savvy.  The reason we bought this product was so that we could author in Word, and work from a single source all the time.  However, I'll do what I have to do -- once I know what that is.
Thanks.

I struggled with the color issue myself for several months and finally had time to figure it out. Word 2007 deals with table styles differently than past versions. In previous versions of word, you could modify table normal style. Now the table normal style assumes all content in the table is using "normal" style. Tables will accept paragraph and character styles only. If you want to customize a table style, modify the table grid style. Fixing the table issue will resolve any use of color you have in your doc even though this may not like it is related. I had the most trouble with orange and shades of purple. RGB only half worked too.
So to fix, using the Developer ribbon, select to modify the Document Template. From the normal.dotm style, copy the Table Normal style into your RH document. Recompile. If you still have the same issue, you will need to dig further. RH processes the topics in your doc in the order that they appear in the doc -- not the toc, so start looking at the beginning of the doc for the first table. Check to see if this table appears correctly in your compiled help file. If it appears correctly, move to the next table and compare it to the compiled help. I found that the table with issues is the one where I had colored borders in my doc table, but in the compiled help they appears as a medium gray shade. Once you ID the table, select the table and on the Table ribbon, right-click on the Table Normal and select apply clearing format or just select Clear.   Recompile. If your colors appear you fixed it. If you still have problems with color appearing, try the next table in the RH doc. To put formatting into your table, highlight your text and bold it -- do not use a style.
For issue 2, when you compile, try changing the options in the generate project. There is an option to use formatted html bullets versus the bullets in the doc. Switch this to use the ones from your doc.
For 3, when you are making the link, you are including the paragraph mark at the end of the bullet which makes the bullet itself and the space inbetween part of the link. In Word, on the format ribbon, click the paragraph mark to show all formatting marks. You should see a paragraph mark after every ending bullet line. Remove the link, then select only the text without the paragraph mark and make your link.
I'm not sure if you are new to RH for Word or not, but here are some tips I use to make using RH easier:
I always work with the show paragraph mark on. It helps me ID what Word is doing easier. I changed the Word Options, Display so it shows all formatting makrs. It also lets you see what is in your links as they are hidden text.
I use the Word Options, Customize to modify my word QAT. I've included many of the table commands such as add row/column, delete row/column, table properties, select table, etc. since the ribbon only shows the table ribbon when you have an existing table your cursor is resting on. I've also added the Styles (classic styles) to the QAT which provides a drop-down list of my styles. The current shortcut of styles on the format ribbon doesn't show you all available styles. Note, Word shows you Popular Commands by default so choose All Commands. You may have to do some trial and error to find the styles that you want to use.
I've also modified the styles to show me the current styles in my doc. This allows me to get rid of styles that may creep into my RH doc that may cause me problems. The list is also shorter for me to choose from. (Choose styles, options, them remove all checkmarks.)
Hope this helps.
bb

Similar Messages

  • Controlling Image Conversion quality from Word to RoboHelp 8

    I cannot find settings that will control image quality when converting Word documents to online help files by means of RoboHelp.
    My problem is that screen captures, which were inserted as PNG or bitmaps, are reproduced with what looks like GIF or JPEG quality in the online help. I want better quality.
    I read that for Famemaker, there are image conversion settings that enable one to preserve full, lossless (screen) resolution during the conversion.
    Is there a way to do this for conversion from Word 2007 documents to RoboHelp 8?
    If not, perhaps RoboHelp 9?
    Much obliged.

    I am importing the Word documents into RoboHelp HTML version 7.0.  I did the following  experiment:
    I imported a document with images containing vector text (the images are in Microsoft Office Object format) from Word 2007 to RoboHelp HTML 7.0, I got poor quality (badly formed text / aliasing). I presume this comes from the rendering and compression performed by the import function. I also saw JPEG artifacts in the raster (screen captures) images of the kind visible at very high compression ratios and which were not visible in the original.
    When I insert the very same images, saved as PNG format at screen resolution, directly into RoboHelp HTML 7.0, I get good quality.
    It seems that the Import from Word function is rendering and converting the images to a compressed format without preserving sufficient quality.
    My questions are:
    Is there a preferred format for the embedded images in Word for better import to RoboHelp, especially when the images contain (vector) text?
    Are there accessible configuration parameters for the Import from Word function, that can control the rendering, and/or the quality level of JPEG compression, and/or give a choice between compressed and uncompressed images.
    How can I access those parameters?
    Thanks!

  • How to import text from Word and retain italics and/or indented text?

    Is it possible to import or copy text from Word into InDesign and retain italics or text that is indented in the Word version?

    just wanna edit wrote:
    Thank you, I think I understand the idea of "place" (which is what I would call "paste")
    The two are not at all the same. Paste involves copying text to the clipboard and then pasting from the clipboard. Place is an import operation.

  • How can I format individual words in a TabbedPanel2 tab?

    It seems that HTML tags are ignored in a SpryTabbedPanels2 tab. I know how to put a background image in via css, but I cannot then align the text to the bottom of the tab, so I cannot fake a large first word with an image. I would like to:
    1/ Be able to format individual words in the tab
    2/ Insert images anywhere in the tab (like you could in the old TabbedPanel)
    3/ Insert breaks <br> in the tab (like you could in the old TabbedPanel)
    4/ Align text within the tab.
    I realise there are four questions here, but they all seem very related to me and hopefully with have either one or four tightly related answers.
    Many thanks
    Jeremy

    You have probably also noticed that
    <div id="TabbedPanels2">
      <h2>Tab 1</h2>
    changes to
    <div class="TabbedPanels" id="TabbedPanels2">
        <div class="TabbedPanelsTabGroup">
        <div class="TabbedPanelsTab TabbedPanelsTabFirst PanelSelectorButtonUnselected">
          <a href="#">Tab 1</a>
        </div>
        <div class="TabbedPanelsTab PanelSelectorButtonUnselected">
            <a href="#">Tab 2</a>
        </div><div class="TabbedPanelsTab TabbedPanelsTabLast TabbedPanelsTabSelected">
            <a href="#">Tab 3</a>
        </div>
      </div>
      <div class="TabbedPanelsContentGroup">
          <div class="TabbedPanelsContent PanelHidden" style="display: none; ">
            <h2 style="display: none; ">Tab 1</h2>
    once it has been through the JS mill.
    My thoughts, although the original version may seem a little bloated, it is robust and easy to customise. Version 2 is slightly more agile and has a few more features, but is an ugly beast when it comes to customisation. In fact the two versions, apart from the Spry name, bear no resemblence to each other.
    I have stuck with the original version as I have done with the menubar.
    Gramps

  • How to link text from Word?

    How can I link the text from Word to InDesign? Is it merely to link the entire document, or can I link the same document multiple times? This is because I want to add pictures and graphs between the lines.

    File > Place.... and select the document. You might want to show import options as you do this. It will import as editable text that you can manipulate in just about any way you like. Ordinarily this text is not linked back to the original file, so subsequent editing in the Word file will not be refelcted in ID, but you can set your preferences before importing to Create Links to Text and Spreadsheet files (under File Handling) if you want to be able to update to any changes (editing and formatting you do in ID will be lost when you update, however). This option can be turned on or off as desired to link some files, but not others.
    If you wish to, you can place the same file multiple times, but there may be simpler ways to get multiple copies, so more details about waht you need to do might help.

  • How to transfer domain from Word-press to iWeb?

    I currently have a website that is hosted by Godaddy, and I use word-press to manage the website. I have re-designed the website in iWeb, and I need help figuring out how to transfer the domain name from word-press to iWeb. Help?

    The following might be of interest to you:
    It is now known that iWeb, and iDVD, has been discontinued by Apple. This is evidenced by the fact that new Macs are shipping with iLife 11 installed but without iWeb and iDVD.
    On June 30, 2012 MobileMe will be shutdown. However, iWeb will still continue to work but without the following:
    Features No Longer Available Once MobileMe is Discontinued:
    ◼ Password protection
    ◼ Blog and photo comments
    ◼ Blog search
    ◼ Hit counter
    ◼ MobileMe Gallery
    All of these features can be replaced with 3rd party options.
    I found that if I published my site to a folder on my hard drive and then uploaded with a 3rd party FTP client subscriptions to slideshows and the RSS feed were broken.  If I published directly from iWeb to the FPT server those two features continued to work correctly.
    There's another problem and that's with iWeb's popup slideshows.  Once the MMe servers are no longer online the popup slideshow buttons will not display their images.
    Click to view full size
    However, Roddy McKay and I have figured out a way to modify existing sites with those slideshows and iWeb itself so that those images will display as expected once MobileMe servers are gone.  How to is described in this tutorial: #26 - How to Modify iWeb So Popup Slideshows Will Work After MobileMe is Discontinued.
    It now appears that the iLife suite of applications offered on disc is now a discontinued product and the remaining supported iApps will only be available thru the App Store from now on. However, the iLife 11 boxed version that is still available at the online Apple Store (Store button at the top of the page) and those still on the shelves of retailers will include iWeb and iDVD. Those two apps were listed in small, gray text on the iLife 11 box that I bought.
    Personally, if I didn't already have a copy I would purchase one to have it for reinstallation purposes if ever needed.
    This may be of some interest to you: Life After MobileMe.
    OT

  • Retaining Formatting of Word Docs

    Is there not a single app that will not strip out all or most of the formatting in Word docs opened through Dropbox? I spend a lot of time generating complex documents with a lot of formatting, and nothing I have tried preserves the formatting on the iPad, regardless of what app I use to open them. I had great hopes for Docs to Go, and then great hopes for Quick Office, but, alas, neither preserves my Word formatting. Do any of you know of any existing app or anything on the horizon that will preserve my formatting. It's becoming a headache to reformat on the iPad.

    Nothing remotely available as yet. On Microsoft's Office web site it says, under system requirements for Office 2007, that it needs 256MB of RAM (check) and at least a 500 MHz processor (check again). So I guess that technically there doesn't seem to be a reason it wouldn't be able to be made to work on the iPad (of course, MS would have to completely rewrite it and they never kept up with their Mac version, let alone the iPad). Unless the iPad base comes to exceed the Mac base (and it well may), I wouldn't expect MS to make that effort. Even then, they still might just say, why bother? We still have the nine hundred gazillion PC computers it works on now.
    I'm thinking that if the clamoring gets so loud about this (and it probably will), then Apple's going to have to do something to address it. They may just have to write such an app themselves. The iPad only just came out, so we really should give it some time. And, as has been said before here, it was never billed as a laptop. It really is more like a glorified PDA (but oh, that glory!). So right now if you want to work on your heavily formatted Word documents, don't leave your laptop at home just yet.

  • How to retain format in excel?

    Is there any way to retain formatting in excel once a retrival is done i.e. Total bold and underlined?Thanks,Calvin

    As long as I remember, you can do this by unchecking the "Use styles" check-box in Essbase/OptionsRegards.

  • How to retain spacing from PDF to Word.

    Hi all,
    Working on a very important project that will involve copying a lot of text excerpts from PDF to .doc files; however, when I try to do this,
    the text's spacing is completely lost. From what I've read elsewhere, this is a very common problem...does anybody know how to fix it?
    I simply do not have to time to type out all of the text I need (hundreds of pages) by hand...
    Thanks so much!

    Hey, first you can try another free pdf reader for mac, like Calibre, to see if the copy and paste problem still remains. The fact is that if you want to preserve the format of a pdf file, copy and paste is not the best way. And manually doing that will take you a lot of efforts. You can try a pdf to word converter for mac. The converter can preserve text, layout and other elements in an editable word document. Sure you don't have to type out all the things, as the software does all the work.

  • How do I save formatting from Word docs to pages?

    Hi
    Often when I open a word document in Pages I get a document warning pop up box.  Often I find that basic things from the Word doc have been changed.  For example, things that were in Bold text in the Word doc are no longer in Bold in the Pages file.  How do I prevent this from happening as the document moves back and forth between myself ( a Pages user) and a clien (who has Word)?

    Hello
    As far as I know, Word create faux-style when a bold or an italic version of a font isn't available.
    In such case, bold or italic will be dropped in Pages.
    From my point of view it's a good choice but it may hurt some users.
    Yvan KOENIG (VALLAURIS, France) lundi 13 juin 2011 16:18:30
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.7
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • How do I retain formatting from previous Pages version

    As I add sections to my pages document (designed in a previous Pages version), I notice that everything is completely messed up.  Pictures & text are being moved to the wrong pages...

    That is due to Pages 5 having a different file format and 100 fewer features than Pages '09.
    At best it alters previous files, at worst it damages them:
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&mforum=iworktipsn trick
    Peter

  • How to retain hyperlinks converting word 2011 to .pdf and Adobe PDF

    I'm having this issue with saving a MS Word 2011 doc.  Hyperlinks are NOT preserved.  Seems unrelated to any browser version.  I'm on OSX 10.7.4.  Have tried the 'built-in' "Save as PDF" option under the PRINT GUI, also tried the "Save as Adobe PDF", as I have Acrobat 10 installed as well.  Appreciate any tips.

    Option A
    If you have Apple Pages…
    Open the Word 2011 document in Pages.
    Go to the File menu, select Export, choose PDF… from the pop out menu and follow the prompt.
    Option B
    Go to the free file conversion web site Zamzar. Follow their four-step process to upload and convert your Word 2011 document to pdf.
    Note: url addresses in the Word 2011 doc do become hyperlinks in the resultant PDF. 
    IMO, what we experience is a Microsoft problem NOT Apple nor Adobe. (Apple Pages retain hyperlinks.) You can help get the attention of Microsoft about this issue. In any of the Office 2011 applications, go to the Help menu and select “Send feedback about Word/Excel/PowerPoint.” That will take you to their Office for Mac Product Feedback web site page. Fill out the form and submit. Note that you can only choose one product to report on at a time. Repeat the feedback by selecting each of the other MS Office 2011 applications.
    HTH

  • How to remove macros from word 2010 documents?

    I have some .dot files that I'm using as templates for a while.
    They used to have Macros to do some stuff and I started to replace those macros with Add-ins.
    What happens is that the macro menus are still there. I tried to remove the macros (using alt+f8 and even alt+f11) but the custom menus are still there! How do I exactly remove those macros and menus from my .dot files?
    I am using Microsoft Word 2010.

    In addition to what Stefan replied you can also check the attached templates by taking the following steps:
    goto File - Options - Add ins - (Below) Manage : choose templates - in the next dialog click on the template and click remove.
    Maurice

  • How to get format from textpane?

    iam changing the color and inserting image in jtextpane after i have to send a mail.
    how to get that formatted data and send to mail plz help in this case.
    change the code and send it. plz...............
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.JTabbedPane.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import javax.swing.text.rtf.*;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    public class loginform extends JFrame {
         JTabbedPane jtp = new JTabbedPane();
         public loginform() {
              Container c = getContentPane();
              JTabbedPane jtp = new JTabbedPane();
              jtp.addTab("COMPOSEMAIL", new ComposeMailPanel());
              c.add(jtp);
              c.validate();
         }//method
         public static void main(String a[]) throws Exception {
              loginform s = new loginform();
              s.setSize(800, 800);
              s.setVisible(true);
         }//main
    }//mainclass
    class ComposeMailPanel extends JPanel implements ActionListener {
         JTextField BCC;
         int start;
         int end;
         JLabel JLabel1;
         JLabel JLabel2;
         JLabel JLabel3;
         JLabel JLabel4;
         JFrame mainFrame = new JFrame();
         JTextField from;
         JTextField subject;
         JButton Send;
         String mailsentaddress = "";
         JButton bInsertPic = new JButton("P");
         JButton bForegroundColor = new JButton("F");
         JFileChooser insertIconFile = new JFileChooser();
         JColorChooser backgroundChooser = new JColorChooser();
         JColorChooser foregroundChooser = new JColorChooser();
         Color foregroundColor;
         JTextPane mainTextPane = new JTextPane();
         SimpleAttributeSet sas = new SimpleAttributeSet();
         MutableAttributeSet sas1 = new SimpleAttributeSet();
         StyleContext sc = new StyleContext();
         MutableAttributeSet mas;
         DefaultStyledDocument dse = new DefaultStyledDocument(sc);
         JScrollPane mainScrollPane = new JScrollPane(mainTextPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
         RTFEditorKit rtfkit = new RTFEditorKit();
         Dimension Size1 = new Dimension();
         public ComposeMailPanel() {
              setLayout(null);
              mainTextPane.setBounds(150, 325, 572, 150);
              mainTextPane.setContentType("text/html");
              mainTextPane.setEditorKit(rtfkit);
              mainTextPane.setDocument(dse);
              mainScrollPane.setBounds(150, 325, 572, 155);
              bInsertPic.setBounds(150, 300, 20, 20);
              bForegroundColor.setBounds(171, 300, 20, 20);
              add(mainScrollPane);
              add(bInsertPic);
              add(bForegroundColor);
              mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              bInsertPic.addActionListener(this);
              bInsertPic.setToolTipText("Insert picture");
              bForegroundColor.addActionListener(this);
              bForegroundColor.setToolTipText("Text color");
              JLabel1 = new JLabel("FROM  :");
              add(JLabel1);
              JLabel1.setBounds(30, 205, 110, 20);
              JLabel2 = new JLabel("BCC :");
              add(JLabel2);
              JLabel2.setBounds(30, 235, 110, 20);
              JLabel3 = new JLabel("SUBJECT :");
              add(JLabel3);
              JLabel3.setBounds(30, 265, 110, 20);
              JLabel4 = new JLabel("MESSAGE :");
              add(JLabel4);
              JLabel4.setBounds(30, 325, 110, 20);
              from = new JTextField();
              add(from);
              from.setBounds(150, 210, 577, 20);
              BCC = new JTextField();
              add(BCC);
              BCC.setBounds(150, 240, 577, 20);
              subject = new JTextField();
              add(subject);
              subject.setBounds(150, 270, 577, 20);
              Send = new JButton("Send");
              add(Send);
              Send.setBounds(720, 495, 65, 20);
              Send.addActionListener(this);
         }// constructor
         public void setAttributeSet(AttributeSet attr) {
              int xStart, xFinish, k;
              xStart = mainTextPane.getSelectionStart();
              xFinish = mainTextPane.getSelectionEnd();
              k = xFinish - xStart;
              if (xStart != xFinish) {
                   dse.setCharacterAttributes(xStart, k, attr, true);
              } else if (xStart == xFinish) {
                   mas = rtfkit.getInputAttributes();
                   mas.addAttributes(attr);
              // The below command line sets the focus to the JTextPane
              mainTextPane.grabFocus();
         public void actionPerformed(ActionEvent ae1) {
              JComponent b = (JComponent) ae1.getSource();
              String str3 = null;
              if (b == bInsertPic) {
                   insertIconFile.setDialogType(JFileChooser.OPEN_DIALOG);
                   insertIconFile.setDialogTitle("Select a picture to insert into document");
                   if (insertIconFile.showDialog(mainFrame, "Insert") != JFileChooser.APPROVE_OPTION) {
                        return;
                   File g = insertIconFile.getSelectedFile();
                   ImageIcon image1 = new ImageIcon(g.toString());
                   mainTextPane.insertIcon(image1);
                   mainTextPane.grabFocus();
              } else if (b == bForegroundColor) {
                   foregroundColor = foregroundChooser.showDialog(mainFrame,"Color Chooser", Color.white);
                   if (foregroundColor != null) {
                        String s1 = mainTextPane.getSelectedText();
                        StyleConstants.setForeground(sas, foregroundColor);
                        setAttributeSet(sas);
              } else if (ae1.getSource() == Send) {
                   String From = "";
                   String To = "";
                   String Subject = "";
                   String Body = "";
                   String Attachment = "";
                   String Hostname = "";
                   From = from.getText();
                   To = BCC.getText();
                   Subject = subject.getText();
                   try {
                        int ki = mainTextPane.getDocument().getLength();
                        Body = mainTextPane.getStyledDocument().getText(0, ki);
                        Hostname = "192.9.200.2";
                        SmtpAttachmentExample example1 = new SmtpAttachmentExample();
                        example1.sendMessage1(Hostname, To, From, Subject, Body);
                        mailsentaddress = BCC.getText();
                   } catch (Exception we1) {
    class SmtpAttachmentExample {
         public void sendMessage1(String hostname, String to, String from,
                   String subject, String body) {
              try {
                   Properties props = System.getProperties();
                   props.put("mail.smtp.host", hostname);
                   Session mailsession = Session.getDefaultInstance(props, null);
                   Message message = new MimeMessage(mailsession);
                   message.setFrom(new InternetAddress(from));
                   message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));
                   message.setSubject(subject);
                   message.setSentDate(new Date());
                   MimeBodyPart messageBodyPart = new MimeBodyPart();
                   messageBodyPart.setText(body);
                   Multipart multipart = new MimeMultipart();
                   multipart.addBodyPart(messageBodyPart);
                   message.setContent(multipart);
                   Transport.send(message);
              } catch (Exception ert) {
         }//withoutattachement
    }thanks in advance
    raja

    here it is...simple is'nt it???
    package jwsdp.test;
    import java.awt.Color;
    import java.awt.Container;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.File;
    import java.util.Properties;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JColorChooser;
    import javax.swing.JComponent;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTabbedPane;
    import javax.swing.JTextField;
    import javax.swing.JTextPane;
    import javax.swing.ScrollPaneConstants;
    import javax.swing.text.AttributeSet;
    import javax.swing.text.DefaultStyledDocument;
    import javax.swing.text.MutableAttributeSet;
    import javax.swing.text.SimpleAttributeSet;
    import javax.swing.text.StyleConstants;
    import javax.swing.text.StyleContext;
    import javax.swing.text.rtf.RTFEditorKit;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    public class loginform extends JFrame {
         JTabbedPane jtp = new JTabbedPane();
         public loginform() {
              Container c = getContentPane();
              JTabbedPane jtp = new JTabbedPane();
              jtp.addTab("COMPOSEMAIL", new ComposeMailPanel());
              c.add(jtp);
              c.validate();
         }//method
         public static void main(String a[]) throws Exception {
              loginform s = new loginform();
              s.setSize(800, 800);
              s.setVisible(true);
         }//main
    }//mainclass
    class ComposeMailPanel extends JPanel implements ActionListener {
         JTextField BCC;
         int start;
         int end;
         JLabel JLabel1;
         JLabel JLabel2;
         JLabel JLabel3;
         JLabel JLabel4;
         JFrame mainFrame = new JFrame();
         JTextField from;
         JTextField subject;
         JButton Send;
         String mailsentaddress = "";
         JButton bInsertPic = new JButton("P");
         JButton bForegroundColor = new JButton("F");
         JFileChooser insertIconFile = new JFileChooser();
         JColorChooser backgroundChooser = new JColorChooser();
         JColorChooser foregroundChooser = new JColorChooser();
         Color foregroundColor;
         JTextPane mainTextPane = new JTextPane();
         SimpleAttributeSet sas = new SimpleAttributeSet();
         MutableAttributeSet sas1 = new SimpleAttributeSet();
         StyleContext sc = new StyleContext();
         MutableAttributeSet mas;
         DefaultStyledDocument dse = new DefaultStyledDocument(sc);
         JScrollPane mainScrollPane = new JScrollPane(mainTextPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
         RTFEditorKit rtfkit = new RTFEditorKit();
         Dimension Size1 = new Dimension();
         public ComposeMailPanel() {
              setLayout(null);
              mainTextPane.setBounds(150, 325, 572, 150);
              mainTextPane.setContentType("text/html");
              mainTextPane.setEditorKit(rtfkit);
              mainTextPane.setDocument(dse);
              mainScrollPane.setBounds(150, 325, 572, 155);
              bInsertPic.setBounds(150, 300, 20, 20);
              bForegroundColor.setBounds(171, 300, 20, 20);
              add(mainScrollPane);
              add(bInsertPic);
              add(bForegroundColor);
              mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              bInsertPic.addActionListener(this);
              bInsertPic.setToolTipText("Insert picture");
              bForegroundColor.addActionListener(this);
              bForegroundColor.setToolTipText("Text color");
              JLabel1 = new JLabel("FROM  :");
              add(JLabel1);
              JLabel1.setBounds(30, 205, 110, 20);
              JLabel2 = new JLabel("BCC :");
              add(JLabel2);
              JLabel2.setBounds(30, 235, 110, 20);
              JLabel3 = new JLabel("SUBJECT :");
              add(JLabel3);
              JLabel3.setBounds(30, 265, 110, 20);
              JLabel4 = new JLabel("MESSAGE :");
              add(JLabel4);
              JLabel4.setBounds(30, 325, 110, 20);
              from = new JTextField();
              add(from);
              from.setBounds(150, 210, 577, 20);
              BCC = new JTextField();
              add(BCC);
              BCC.setBounds(150, 240, 577, 20);
              subject = new JTextField();
              add(subject);
              subject.setBounds(150, 270, 577, 20);
              Send = new JButton("Send");
              add(Send);
              Send.setBounds(720, 495, 65, 20);
              Send.addActionListener(this);
         }// constructor
         public void setAttributeSet(AttributeSet attr) {
              int xStart, xFinish, k;
              xStart = mainTextPane.getSelectionStart();
              xFinish = mainTextPane.getSelectionEnd();
              k = xFinish - xStart;
              if (xStart != xFinish) {
                   dse.setCharacterAttributes(xStart, k, attr, true);
              } else if (xStart == xFinish) {
                   mas = rtfkit.getInputAttributes();
                   mas.addAttributes(attr);
              // The below command line sets the focus to the JTextPane
              mainTextPane.grabFocus();
         public void actionPerformed(ActionEvent ae1) {
              JComponent b = (JComponent) ae1.getSource();
              String str3 = null;
              if (b == bInsertPic) {
                   insertIconFile.setDialogType(JFileChooser.OPEN_DIALOG);
                   insertIconFile.setDialogTitle("Select a picture to insert into document");
                   if (insertIconFile.showDialog(mainFrame, "Insert") != JFileChooser.APPROVE_OPTION) {
                        return;
                   File g = insertIconFile.getSelectedFile();
                   ImageIcon image1 = new ImageIcon(g.toString());
                   mainTextPane.insertIcon(image1);
                   mainTextPane.grabFocus();
              } else if (b == bForegroundColor) {
                   foregroundColor = foregroundChooser.showDialog(mainFrame,"Color Chooser", Color.white);
                   if (foregroundColor != null) {
                        String s1 = mainTextPane.getSelectedText();
                        StyleConstants.setForeground(sas, foregroundColor);
                        setAttributeSet(sas);
              } else if (ae1.getSource() == Send) {
                   String From = "";
                   String To = "";
                   String Subject = "";
                   String Body = "";
                   String Attachment = "";
                   String Hostname = "";
                   From = from.getText();
                   To = BCC.getText();
                   Subject = subject.getText();
                   try {
                        int ki = mainTextPane.getDocument().getLength();
                        ByteArrayOutputStream l_out = new ByteArrayOutputStream();                  // added by Guilllaume
                        mainTextPane.getEditorKit().write(l_out,mainTextPane.getDocument(),0,ki);   // added by Guilllaume
                        Body = new String(l_out.toByteArray());                                     // added by Guilllaume
                    //     Body = mainTextPane.getStyledDocument().getText(0, ki); // supress by Guilllaume
                        Hostname = "192.9.200.2";
                        SmtpAttachmentExample example1 = new SmtpAttachmentExample();
                        example1.sendMessage1(Hostname, To, From, Subject, Body);
                        mailsentaddress = BCC.getText();
                   } catch (Exception we1) {
    class SmtpAttachmentExample {
         public void sendMessage1(String hostname, String to, String from,
                   String subject, String body) {
              try {
                   Properties props = System.getProperties();
                   props.put("mail.smtp.host", hostname);
                   Session mailsession = Session.getDefaultInstance(props, null);
                   Message message = new MimeMessage(mailsession);
                   message.setFrom(new InternetAddress(from));
                   message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));
                   message.setSubject(subject);
                   message.setSentDate(new Date());
                   MimeBodyPart messageBodyPart = new MimeBodyPart();
                   messageBodyPart.setText(body);
                   Multipart multipart = new MimeMultipart();
                   multipart.addBodyPart(messageBodyPart);
                   message.setContent(multipart);
                   Transport.send(message);
              } catch (Exception ert) {
         }//withoutattachement
    }

  • How to import text from Word without any style?

    Hi all.
    I'm working with a copy writer who has a tendency to apply a return on every line on the Word document.
    How can I over ride it so that I don't have to go back and eliminate every return in InDesign?
    Thanks!

    I use a text editing tool called TextWrangler by Bare Bone Software.
    http://www.barebones.com/products/textwrangler/
    Open in Word
    Copy/Paste into Text Wrangler
    Use the
    Text > Remove Line Breaks
    Copy/Paste into InDesign
    This will strip ALL formatting, and remove those pesky extra returns.
    -mt
    Any chance that you can educate the copy editor that the computer with MS Word is not a fancy Typerwriter and that there is no need to manually perform a carriage return?

Maybe you are looking for

  • Getting my MiniMax working with my Airport Extreme

    I bought a 500GB MiniMax and an Airport Extreme (new style 802.11n) at the weekend. I've got the Airport Extreme working fine and am trying to use the MiniMax as a drive attached to the Airport Extreme via USB2.0. I want to attach to the MiniMax wire

  • MDM Old purchase Order and Template Problem

    Hello, We are on SRM 5 (SP12) and using MDM catalog. We have a problem when we want to create an e-catalog shopping cart in copy of an old one which was correct. The price of the new shopping cart get to 0 but in the old shopping cart it was 23,23...

  • Regarding ABAP query when using the LDB

    Hi Experts, Iam preparing one ABAP query by using LDB. And i added two more table VBPA and KNA1. When i add the VBPA table the system will automatically generate the sql query and we need to pass the where condition to thet query. system generated li

  • Error while reading Static content

    can anybody help me understand the reason behind the following error and the way to its resolution? org.w3c.www.protocol.http.HttpException: The host name couldn't be resolved Thanks, Atul

  • Captivate 8 corrupting files

    Is anyone else having issues with Captivate 8 corrupting files? This is absolutely ridiculous! Come on Adobe get your act together. Version 8 of the software and we are still having to deal with file corruptions!! Instead of worrying so much about th