OLE2 Doc/Code snippet to assist in creating a word doc with underlined text

I would like to use OLE2 to create a simple Word document. I would like some of the text to be bold/underlined and the rest of the text to be regular. There seems to be a serious dearth of information regarding OLE2 in conjunction with PS/SQL in Word applications. We're running Forms 6 and Oracle 9i.
I don't believe that I need to use the techniques described in the Forms Manual (OLE2 containers, etc.). I have managed to create a Word doc and write some text to it but I've been unable to find out/guess at the syntax that I'd need to control bolding and underlining. It would be a big help if I could just find the syntax for Word OLE2 commands. During my documentation search, I seem to remember a post that mentioned 'Reference 2' and maybe 'Reference 3' as a source of information related to OLE2 in PL/SQL code. If anyone can give me a shove in the right direction I'm more than willing to read the manuals. I won't be too disappointed if someone could send me a code snippet either!
Thanks,
Ron Walker

Hi Ron,
Office ships with a number of resources that you will find indispensable for the sort of work you're doing. Take a look at the VBA IDE (Visual Basic for Applications IDE). You may already be familiar with it, if you've ever written a Word macro, but to call it a macro editor sells it short -- it is a full-blown development environment. Its Object Browser allows you to browse Word's object model, search by keyword, and view call syntax.
In case you aren't familiar with the VBA IDE, try this:
1. Open Word
2. Switch between Word and the VBA IDE by pressing <Alt><F11>
3. Open the Object Browser by pressing <F2>
Spend some time familiarizing yourself with the Object Browser. Constrain its scope by selecting the Word library instead of <All Libraries> (the default). Learn to search by keyword. Click on items within your results for details. If Visual Basic Help is installed, pressing <F1> will raise help on a selected item.
Visual Basic Help may not be part of the Compact or Typical install. Running Office Setup, either from the install CD, or through Add/Remove Programs under Control Panel, will allow you to add the feature. (The Office installer lists Visual Basic Help in the Office Tools section.)
I have found the VBA IDE to be the perfect place for prototyping and testing automated processes. It is a far friendlier environment for learning Office automation, as it offers code completion and context-driven help. Once the process works, I manually translate my VBA routine into Forms PL/SQL, which is fairly painless. I've written a short tutorial, that I will post shortly -- I didn't want to bury it in this thread!
Hope this helps,
Eric Adamson
Lansing, Michigan

Similar Messages

  • Is it possible to create a word doc or excel in iPad Air

    Is it possible to create a word doc or excel in iPad Air? Also is it possible to open or transfer documents from my computer to my iPad?

    Abu1 wrote:
    Is it possible to create a word doc or excel in iPad Air?
    Yes. you will need the appropriate apps to do that. some options:
    Apple's Pages and Number. These will create documents in their respective native formats, but can be exported in Word or Excel (among others) as needed. They will also import from those formats (with limitations)
    MS has published Word and Excel fort the iPad, but in order to create of edit files, you need an Office 365 subscription ($99 USD per year, I believe)
    There are a number of other apps available in the apps store that will also accomplish this for you.
    Just be aware that regardless of the apps chosen, there will be limitations compared to Word and Exel for PC (I don't know of any app for iOs that can handle pivot tables, for example)
    Abu1 wrote:
    Also is it possible to open or transfer documents from my computer to my iPad?
    Yes, several options, including syncing via itunes. However, you may fiond using a cloud service is more convenient. What you chose will depend on teh editing apps you use.I use DropBox and Box externsively, as well as iCloud (if you opt for Apple's apps). Skydrive would be your best option if you use MS apps.

  • I have an agreement form created in word doc. i want to hire some one experience with formscentral to recreate the form and user be able to complete the agreement, sign it electronically (using echosign) then click submit. i will be alert of new response.

    i have an agreement form created in word doc. i want to hire some one experience with formscentral to recreate the form and user be able to complete the agreement, sign it electronically (using echosign) then click submit. i will be alert of new response. can someone connect me to where i can talk to someone can provide this service. i have sample of agreement form

    Hi c3 cyber club,
    Unfortunately FormCentral and Echosign are two different services and forms created in Forms central can only be submitted via and to Forms Central.
    We cannot have the form filled in using FormCentral and get it signed using Echosign.
    However, you can use Echosign directly and you can get most of the functionality.
    Thanks,
    Vikrantt Singh

  • Create a word document with TOC, table,etc

    Hi,
    How to create a word document with Table of content(TOC),header, footer, table, etc?
    Help me with any APIs or examples. I have already tried with POI API, but couldnt create TOC.. So any other api or any solution is available to create complex word document.
    Thank you

    Hi BIJ001,
    Thanks for your valuable suggestion.
    Open standards WordprocessingML format is supports by Microsoft word. It is typical xml format of designing word document. But creating document with TOC,tables, different styles of paragraphs are complex. Using this format, i have created simple docs. I never tried with complex formats like TOC. The generating File should be in ".doc or .docx" format only.
    Hi gimbal2,
    I am parallely looking to find solution in OpenOffice format also. But i never try out ".docx" file format. I will try to look out this option.
    Thanks for the input.
    Edited by: user13735134 on May 24, 2011 6:55 AM

  • I created a word document with hyperlinks. When my default browser is Chrome the hyper links work. When the default browser is Safari, the hyperlinks bring to pages that just lines and lines of symbols. I need these links to work in both browsers.

    I created a word document with hyperlinks. When my default browser is Chrome the hyper links work. When the default browser is Safari, the hyperlinks bring to pages that just lines and lines of symbols. I need these links to work in both browsers. Any ideas?

    version 10.6.8

  • I have two pdf docs that I used Acrobat to convert to word docs.  How do I extract one page from one doc to insert into the other doc?

    I have two pdf docs that I converted to Word Docs using Acrobat Pro.  How do I extract one page from the first doc and insert it into the second doc?  When I "select all" it grabs the entire document.  I need to take pages out, put other pages in, and edit some of the text.

    HI djlarp,
    Try triple-clicking in the text that you want to select--it can sometimes be tricky to select text in a converted document. If that doesn't work, it could be that the PDF document was created from a scanned document, and OCR wasn't enabled when you converted the document. (However, OCR is enabled by default when you convert via the ExportPDF website.)
    If you're unable to select text by triple-clicking, let us know. I would be happy to take a closer look at your files.
    Best,
    Sara

  • About create a Word file with Jacob

    Hello!
    I want to create a new MSWord document with Jacob. All the examples that I have seen are for MSExcel and me do not serve. How I can create this document, insert text and images, the application to record and to close it from Java?
    This it is the code that I use to open the application, but it trumps me when I try to create a new document.
    public class DispatchTest {
    public static void main(String[] args) {
    ActiveXComponent dc = new ActiveXComponent ("Word.Application");
    try {
    dc.setProperty("Visible", new Variant(true));
    Object documents = dc.getProperty("Documents").toDispatch();
    Object document = Dispatch.get(documents, "Add").toDispatch();
    } catch (Exception e) {
    e.printStackTrace();
    Thank you very much!

    Hi,
    Here is the code which is used to open an Word or Acrobat Reader.
    import java.lang.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class Demo1 extends JFrame implements ActionListener {
    JMenuBar mbar = new JMenuBar();
    JMenu file = new JMenu("File");
    JMenuItem n_pad = new JMenuItem("Notepad");
    JSeparator sep = new JSeparator();
    JMenuItem m_word= new JMenuItem("Ms Word");
    JMenuItem a_bat = new JMenuItem("Acrobat Reader");
    public Demo1(){
    setUpMenuBar();
    public void setUpMenuBar(){
    file.add(n_pad);
    file.add(m_word);
    file.add(sep);
    file.add(a_bat);
    mbar.add(file);
    setJMenuBar(mbar);
    n_pad.addActionListener(this);
    m_word.addActionListener(this);
    a_bat.addActionListener(this);
    public void display(ActionEvent evt1){
    Runtime r= Runtime.getRuntime();
    Process p=null;
    try{
    if(evt1.getSource()==n_pad){
    p=r.exec("notepad.exe"+" "+"c \\javafiles\\listit.java");
    p.waitFor();
    else if(evt1.getSource()==m_word){
    // p=r.exec
    ("rundll32"+" "+"url.dll,FileProtocolHandler"+" "+"Winword.exe"+" "+"file /
    /c \\newcorpus\\index.htm");
    //p=r.exec
    ("rundll32"+" "+"url.dll,FileProtocolHandler"+" "+"Winword.exe"+" "+"c \\ja
    vafiles\\listit.java");
    p=r.exec
    ("rundll32"+" "+"url.dll,FileProtocolHandler"+" "+"Winword.exe");
    p.waitFor();
    else if(evt1.getSource() == a_bat){
    //p=r.exec
    p=r.exec("rundll32"+" "+"url.dll,FileProtocolHandler"+" "+strFile);
    //strFile gives the complete path where it is saved
    /* ("rundll32"+" "+"url.dll,FileProtocolHandler"+" "+"Acrord32.exe 'c \\javaf
    iles\\jspintro.pdf'");
    p=r.exec
    ("rundll32"+" "+"url.dll,FileProtocolHandler"+" "+"Acrord32.exe");
    p.waitFor();
    }catch(Exception e){e.printStackTrace();}
    public void actionPerformed(ActionEvent evt){
    display(evt);
    public static void main(String args[]){
    Demo1 md=new Demo1();
    md.setVisible(true);
    md.setSize(200,300);
    I hope this will help you.
    Thanks
    Bakrudeen
    Technical Support Engineer
    Sun MicroSystems Inc, India

  • Created a word doc with links to pdfs, is Adobe XI standard enough to merge as one pdf document

    I am looking to create one flowing document, without the need to send customers lots of attachments.  I have a word document which has links to several other document types, usually pdf sometimes these have minimal volume other times these can be large in volume.  Currently I have to send all the documents as a folder, but I would like to send one tidy document, so if I convert to a pdf with Adobe XI standard will my linked documents be automatically inserted creating one document (I have not purchased yet, researching first)?

    The linked documents will not be automatically converted to PDFs and merged
    with your file, neither in Acrobat Standard nor in Acrobat Pro. You can do
    it, but you'll need to do it manually by converting all the files to PDFs,
    merging them and then adding the links between them.

  • EMF graphics demaged in PDF created in Word 2010 with Acrobat X Pro,

    We export EMF from a modelling tool and insert the EMF graphics in Word (see Word window). Creating a PDF with Acrobat X Professional leads to a damaged graphic (see Acrobat window). It was no problem in the Word 2003 & Acrobat 7 Pro "suite"...
    What can I do to get embedded EMF graphics as before?

    Hi pwhite2315,
    Could you please let me know what version of Acrobat are you using.
    Try using 'Create PDF' option under Acrobat ribbon in your word file and check for the same.
    Also, please open 'Preferences' for Acrobat PDFMaker and check what 'Conversion Settings' have you selected.
    Let me know.
    Regards,
    Anubha

  • Create MS-Word document (With format)

    Hi all,
    I need to create from abap program to MS-Word a document that can have format, for example: bold letter, align paragraph, insert image, etc.  This is possible?.
    Please send me a example.
    Thank u.
    John.

    hi,
    may be OLE can help you...
    try out this link...
    http://help.sap.com/saphelp_47x200/helpdata/en/59/ae3cac488f11d189490000e829fbbd/frameset.htm
    regards,
    PJ

  • How to Create a Clipping Mask with LIVE TEXT?

    Please, please, pease...there's has to be a way to do this.
    I'm currently working on a project in which I have a background that has a large text layer above it. What I want to do is create a sort of "dynamic" clipping mask that essentially subtracts the shape of the text from the background yet remains editable as text in case I need to change the word or font.
    However every way I've tried so far as been met with the backgrouns instead being constrained inside of the shape of the text...which is NOT what I want.
    How can I do this while still having the text able to be edited?

    An Opacity mask will work, but it will also move artwork from various layers to one layer.
    You can get the same effect with a Layer Clipping mask and keep objects on their layers.
    In this example only one layer is clipped, but you can drag as may as you want below the clipping layer.

  • Reading ams word doc and creating another ms word doc with this same data

    I have a ms word doc and i hav to create different word docs from it with different name.The docs will contain the same data as the mother document but some cases,some strings will be replaced by some new strings for each document to be created.plz help me out.
    File ReadDocFileInput = new File(inFilePath + "APX-DBEST.DOC");
    BufferedReader readXML = new BufferedReader(new InputStreamReader(new FileInputStream(outFile)));
              String FirstTag = null;
              String writeIntoDoc = null;
              String writeTagName = null;
              String writeTagSTEPName = null;
              File WriteDocFileOutput = new File(inFilePath + "APX-DBEST-" + writeTagName + ".RTF");
              BufferedReader fis = new BufferedReader(new InputStreamReader(
                        new FileInputStream(ReadDocFileInput)));
              //FileInputStream fis = new FileInputStream(ReadDocFileInput);
              //FileOutputStream fos = new FileOutputStream(WriteDocFileOutput);
              PrintWriter fos = new PrintWriter(new FileOutputStream(WriteDocFileOutput) );
              //int i =0;
              //char ch;
              while((writeIntoDoc = fis.readLine())!=null){
                   //ch = (char)i;
                   fos.write(writeIntoDoc);
              fis.close();
              fos.close();
              //WriteDocFileOutput.renameTo(new File(inFilePath + "APX-DBEST-" + writeTagName + ".DOC"));
    this is the code i hav written...anything wrong in it?...it does not working.

    I didn't read your code. But if you want to copy a file, commons has a neat tool for it:
    import org.apache.commons.io.IOUtils;
    import java.io.*;
    class CommonsFileCopy {
        public static void main(String[] args) {
            String fIn = "CommonsFileCopy.java";
            String fOut = "(copy) CommonsFileCopy.java";
            try {
                InputStream inStream = new BufferedInputStream(new FileInputStream(fIn));
                OutputStream outStream = new FileOutputStream(new File(fOut));
                IOUtils.copy(inStream, outStream);
                System.out.println("Copied \""+fIn+"\" to \""+fOut+"\" successful");
            catch(IOException ioe) { ioe.printStackTrace(); }
    }

  • Error using the distiller in Acrobat Professional 8 to create a PDF from an Aspose.Words .doc docume

    Hi,
    We use Aspose.Words to create Microsoft Word (.doc) documents from one of our Intranet applications. These documents are then further modified in Microsoft Word and are then converted to PDF files using the distiller in Acrobat 8 Professional.
    The distiller ends with a message saying it encountered an error and could not complete the conversion.
    If we create a document directly in Microsoft Word and then use the distiller to convert it to a PDF, the distiller runs just fine.
    Would you have any idea of what might be causing this problem? The distiller gives no indication of the cause of the problem, only that is one!
    I also tried using the Create Adobe PDF Online service to convert the same Aspose.Words .doc file and it worked fine.
    Any help you can give on this would be most appreciated!
    Thanks!

    Thanks for your response. I mistakenly referred to the distiller.
    We are using PDF Maker in Word. It appears as an icon on the Word toolbar once Acrobat Professional 8 has been installed. When I open the Aspose.Words .doc document in Word and click on the toolbar icon, PDF Maker launches and starts the conversion program and then Microsoft Word ends with their standard message "Microsoft Word has encountered an error and needs to close...".
    I also tried going into Acrobat Professional 8 and chose File --> Create PDF --> From File off the menu bar. I selected the same Aspose.Words .doc document file to convert and once again the conversion process started, but this time it gave me the following error message:
    "Unable to convert PDF file.
    Invalid page range or conversion setting parameters."
    When I clicked on OK to clear the message, I got the following:
    "Acrobat could not open 'xxxxx.doc' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).
    To create an Adobe PDF document, go to the source application. Then print the document to Adobe PDF or use the Acrobat toolbar found in Microsoft applications."
    I assume that since the on-line service can successfully convert this document, it is a supported file type and is not damaged (not sent as an email attachment, so no issue there). I tried opening the document in Word and printing it to Adobe PDF and that worked, but my users really like the convenience of the Acrobat toolbar so I would like them to be able to use it to create PDF files from Aspose.Words documents.
    I am using all the default settings. Is there some setting I should be changing?
    As I mentioned earlier, I did try the Create Adobe PDF on-line service with this same file and it worked just fine, so there seems to be a difference between how the on-line service does the conversion and how PDF Maker does it. Printing the document to Adobe PDF also works, so again, there must be some difference in the way PDF Maker does it.
    Any guidance you can give me would be greatly appreciated!
    Thanks very much!

  • Stylesheets and applying to imported Word docs. (RHx5)

    I've been reading a comments about style sheets, importing Word docs and formatting issues (in regards to importing Word docs and pre-determined styles/bullets/numbering).  I also saw that someone was trying to create a css outside of RH and was having issues.  This leads me to a couple of questions.
    1.  When importing Word docs, does RH create a separate css for each doc, or is there an option to not have this occur when performing the import process?
    2.  If I am understanding css', you should only have one per project, if you want all of html pages to appear identical, correct?
    3.  What do you do if you've made the mistake of having several different css' out there, making everything appear funky?  Can you create a new project and import the documents without the css and apply a new css (created in the new project) to all of the html files?  Will this assist in correcting a lot of the spacing, bullet and numbering problems?
    4.  Can I view the default css and edit it?
    I think I have a big problem on my hands.  I was trying to make things easier for SMEs who were designated to write procedures in Word by creating the pre-defined formats.  After reading PG's pages, I sunk into my chair.  I was having the problems he mentioned.  I tried to edit some of the pages in the html editor and appear to have made them worse.  I was trying to simplify the code a little (with what knowledge I currently have with html, which is minimal).  I am fortunate that I only have about 200 documents that could be impacted.  Any comments/suggestions are greatly appreciated.
    Rob

    1] When importing Word docs, does RH create a separate css for each doc, or is there an option to not have this occur when performing the import process?
    That's the way it is, no option.
    2.  If I am understanding css', you should only have one per project, if you want all of html pages to appear identical, correct?
    With the "if you want them identical" proviso, you would only have one CSS but you don't have to have them all identical. That is your call.
    3.  What do you do if you've made the mistake of having several different css' out there, making everything appear funky?  Can you create a new project and import the documents without the css and apply a new css (created in the new project) to all of the html files?  Will this assist in correcting a lot of the spacing, bullet and numbering problems?
    It's not a mistake but if you want to get out of that situation, you need to do some cleaning up. The first step will be to create a CSS that contains all your existing style names, note I say names. Each of your CSS files will have a variety of styles but let's make it easy for this explanation. One has H1, H2, P and P.Note (a class) while another has One has H1, H2, P and P.Warning (a class). Now let's say you have just two topics, one has CSS_1 and one has CSS_2. The H1, H2 and P styles may be the same or different but assuming they are different, you now want them to be the same so what you want is a CSS with H1, H2, P, P.Note and P.Warning. You could then apply that to both topics and all the content would be displayed as defined in CSS_3. Obviously the real task is bigger but the principals are the same.
    The way I would tackle it is to create a new CSS and copy in the styles from the biggest of your existing CSS files. Then I would look at the others and copy in any styles that are not already in. That gives you all the style names, albeit with the wrong appearance. Then you start working through the styles to get them right. It is not as bad as it sounds. I recommend using Top Style from http://www.bradsoft.com. There's a free version that only opens one CSS at a time but you can see what you are doing with it. The others can be open in Notepad.
    4.  Can I view the default css and edit it?
    Yes.
    I think I have a big problem on my hands.  I was trying to make things easier for SMEs who were designated to write procedures in Word by creating the pre-defined formats.  After reading PG's pages, I sunk into my chair.  I was having the problems he mentioned.  I tried to edit some of the pages in the html editor and appear to have made them worse.  I was trying to simplify the code a little (with what knowledge I currently have with html, which is minimal).  I am fortunate that I only have about 200 documents that could be impacted.  Any comments/suggestions are greatly appreciated.
    Next time you need input from the SMEs, output to one Word template from RH so that they all have the same appearance. Their job is provide content so the styles are irrelevant to them.
    Yes you've got some work but it isn't too massive. Hope this helps.
    See www.grainge.org for RoboHelp and Authoring tips

  • How to identify the text color in a word doc.?

    how to identify the text color in a word doc.?
    I need to read a word document using java code. which contains many strings with different colors.
    i need to identify the color and giving the marks accordingly like
    test in blue color so
    test marks=2
    how can i do this using java. i only want to know how can i identify the text color using java code.?

    morgalr wrote:
    I guarantee it is not pretty.Indeed.
    I created a Word doc that simply has the word "Blue" in blue, then a space, then the word "Red" in red, all in the default font that Word started with (Times New Roman). The resulting document is 24,064 bytes. It starts off with 80 bytes of various hex values, mostly 0x00.Then 432 bytes of just 0xFF. Then 2048 bytes of various hex values, mostly 0x00. Then the text "Blue Red" (which appears twice more in the file). And so on...
    Edited by: jverd on May 10, 2010 8:45 AM

Maybe you are looking for

  • SSIS importing comma delimited with double quote text qualifier - Works in VS - SQL Job ignores text qualifier and fails (truncation)

    I've created an SSIS package to import a comma delimited file (csv) with double quotes for a text qualifier ("). Some of the fields contain the delimiter inside the qualified text. An example row is: 15,"Doe, John",IS2,Alabama In SSIS I've specified

  • Hard Drive Crash!  Music safe / Library.xml not

    I lost my boot drive last week and apple care had to install a new HD. None of my old data could be recovered. Needless to say, my "iTunes Music Library.xml" is gone. Is there a way to recreate it? I still have my iPod, can it be used to help recreat

  • Split valuation : how to differentiate revenue accounts

    Dear all, is there any possibility to manage different revenue accounts for material with different valuation types? I mean if I activate split  valuation for a material which has two valuation type: purchase and production accounting department of m

  • WEB DYNPRO ABAP IN NETWEAVER 04

    Hi to all When, in my system, I view System / Status, I view that in component versions appear "Netweaver 04". In this version: I can develop web dynpro for abap ??? Thank you by the information Regards Dario Rodriguez.

  • Logging In On A MacBook Air

    So my MacBook does this thing where when it wakes up from being in sleep mode, I'm not able to hear anything. The only solution for this is restarting my Mac. Once I restarted it and tried to log back in, it wouldn't accept my password. I did the who