Convert strings to publicKey/privateKey objects

Hi,
I have the following problem : I'm generating RSA key pairs in string formats. I want to sign an XML document so I have to specifiy KeyPair object in order to do that.
How can I convert string to publicKey and privateKey objects ?
i.e How can I correct this code :
String pubKey = generatePublicKey();
String priKey = generatePrivateKey();
KeyPair kp = new KeyPair(pubKey,priKey);
// sign the XML documents
Thanks a lot for your precious help.
Cheers,
Othman.

http://forum.java.sun.com/thread.jspa?threadID=577716&tstart=0

Similar Messages

  • Converting string to xml Document object.

    Hi all,
    I having a string consiste of xml data.
    I wants to convert this to an xml document object.
    When i am trying to do this i am getting fatal error Premature End of file.
    This is sample code from my program.
    String xmlStr = " <TravelItineraryAddInfoRQ>
    <POS>
    <Source PseudoCityCode="A2PB"/>
    </POS>
    </TravelItineraryAddInfoRQ>";
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware( false );
              DocumentBuilder builder = null;
              char[] ch = new char[1200];
    builder = factory.newDocumentBuilder();
    StringReader sr = new StringReader(xmlStr);
    InputSource is = new InputSource(sr);
    Reader r = is.getCharacterStream();
    r.read(ch);
    System.out.println("String Starting ==== ");
    for(int i=0;i<ch.length;i++)
    System.out.print(ch);
    Document XMLDoc = builder.parse(new InputSource(sr));
    System.out.println("Document Object ==== "+XMLDoc);
    thnx,
    raj

    Hi Rajaven,
    use the below step, I think it could help u
    StringBufferInputStream sb = new StringBufferInputStream(strBf));
    doc = db.parse(sb);first conver a string to StringBufferInputStream then parse to doc Object
    hope it will solve.
    let me know if it's not working
    With cheers,
    PrasannA

  • Reading a PublicKey \ PrivateKey type from a txt file

    Hi,
    i want to read a PublicKey \ PrivateKey type from a txt file and input it into a method.
    How can i read the data from the file while keeping or converting back to PublicKey \ PrivateKey type?
    I'm working with the following:
    generate = KeyPairGenerator.getInstance("ECDSA", "FlexiEC");                              
    generate.initialize(ecParams, new SecureRandom());
    KeyPair keyPair = generate.generateKeyPair();
    ............continues
    **and then i write the keys to the a simple txt file.**
    thanks!
    Edited by: sk16 on Apr 8, 2010 10:03 PM

    So, if i work with the two above is it ok, like:
    generate = KeyPairGenerator.getInstance("ECDSA", "FlexiEC");
                   generate.initialize(ecParams, new SecureRandom());
                   KeyPair keyPair = generate.generateKeyPair();
                   // Pub. and Priv. key objects.
                   PublicKey publicKey = keyPair.getPublic();
                   PrivateKey privateKey = keyPair.getPrivate();
                   // Write keys to separate files.
                   FileOutputStream fos = new FileOutputStream(publicKeyFile);
                   fos.write(publicKey.getEncoded());
                   fos.close();
                   FileOutputStream fos1 = new FileOutputStream(privateKeyFile);
                   fos1.write(privateKey.getEncoded());
                   fos1.close();
    and then for example>>>
    DataInputStream in = new DataInputStream(
              new FileInputStream("publicKeyFile.txt"));
              byte[] encodedPublicKey = new byte[1024];
              in.read(encodedPublicKey);
              in.close();
              X509EncodedKeySpec encodedPublicKeySpec = new X509EncodedKeySpec(encodedPublicKey);
              KeyFactory keyFactory = KeyFactory.getInstance("ECDSA", "FlexiEC");
              publicKey = keyFactory.generatePublic(encodedPublicKeySpec);

  • Convert String variable value  to an Object referece type

    Hi all,
    I want to know that if there any possible way to convert String variable value to a Object reference type in java. I'll explain by example if this is not clear.
    Let's think that there is a string variable name like,
    String name="HelloWorld";
    and there is a class name same to the variable value.
    class HelloWorld
    I am passing this string variable value to a method which is going to make a object of helloworld;
    new convertobj().convert("HelloWorld");
    class convertobj{
    public void convert(String name){
    // in hert it is going to create the object of HelloWorld;
    // HelloWorld hello=new HelloWorld(); just like this.
    now i want to do this from the name variable value.( name na=new name()) like wise.
    please let me know if there any possible way to do that.
    I am just passing the name of class by string variable then i wanted to make a instance of the class which come through the variable value.
    thanx.

    Either cast the object to a HelloWorld or use the reflection API (Google it) - with the reflection API you can discover what methods are available.
    Note: if you are planning to pass in various string arguments and instantiate a class which you expect to have a certain method... you should define an interface and have all of your classes that you will call in this way implement the interface (that way you're sure the class has a method of that name). You can then just cast the object to the interface type and call the method.
    John

  • How Do I Convert a String that Names an Object to a Reference to the Object

    You get many program-specific object names in the XML that is returned by describeType.  Suppose I find an object that interests me.  What is the best way to convert the String that names the object (e.g. the id of the object) to a reference variable that points to the object? 

    Sure.  I am working on a complex application that involves several ViewStacks, several Accordions, some checkboxes, some radio buttons, some text boxes.  These components are scattered about, but all are children of a base class that is successfully enumerated by
    var classInfo:XML = describeType(vwstk);
    Suppose I write a loop as follows:
     for each (var a:XML in classInfo..accessor){
    Inside that loop I have a series of tests like
    if (a.@type == "mx.controls::CheckBox"{
    Then, I iterate thru all of the children of the base class as in:
    for  
    (var u:Object in vwstk)
    {        if  
    Inside the if I persist the checked/not checked status of the checkbox.
    The tricky part is going from the string a.@name to the Object reference u.  I doubt my proposed method will work.  Do you have a better idea?

  • Converting Strings to Color Objects

    Greetings All -
    I'm in my first Java class (I was a C programmer in the 80s!) and am a little stumped on an assigment. Your help will be much appreciated.
    I have to read color strings out of an HTML file and put them in a HashMap (a small applet assignment). I've been unable to find an elegant method for converting from a string to a color object.
    Please let me know if I'm stuck with a big nested if or am I overlooking something?
    Thank you -
    Gargoyle

    This will handle #rrggbb strings, and also the dozen or so colors defined by name (red, cyan, etc) in the static fields of java.awt.Color:
    static Color stringToColor (String s)
         try {
              return Color.decode(s);
         } catch (Exception e) {}
         try {
              return (Color) Color.class.getField(s).get(null);
         } catch (Exception e) {}
         System.out.println("bad color string: " + s);
         return null;
    }

  • Convert String to Date and Format the Date Expression in SSRS

    Hi,
    I have a parameter used to select a month and year  string that looks like:    jun-2013
    I can convert it to a date, but what I want to do is,  when a user selects a particular month-year  (let's say "jun-2013")
    I  populate one text box with the date the user selected , and (the challenge Im having is)  I want to populate a text box next to the first text box with the month-year  2 months ahead.    So if the user selects 
    jun-2013   textbox A will show  jun-2013 
    and textbox B will show  aug-2013..
    I have tried:
    =Format(Format(CDate(Parameters!month.Value  ),  
    "MM-YYYY"  )+ 2  )   -- But this gives an error
    This returns the month in number format   like "8"    for august...
    =Format(Format(CDate(Parameters!month.Value  ), 
    "MM"  )+ 2  )
    What is the proper syntax to give me the result    in this format =  "aug-2013"  ???
    Thanks in advance.
    MC
    M Collier

    You can convert a string that represents a date to a date object using the util.scand JavaScript method, and then format a date object to a string representation using the util.printd method. For more information, see:
    http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.1254.html
    http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.1251.html
    In your case, the code would be something like:
    var sDate = "2013-01-10";
    // Convert string to date
    var oDate = util.scand("yyyy-mm-dd", sDate);
    // Convert date to new string
    var sDate2 = util.printd("mm/dd/yyyy", oDate);
    // Set a field value
    getField("date2").value = sDate2;
    The exact code you'd use depends on where you place the script and where you're getting the original date string, but this should get you started.

  • Converting strings to the floating number and plotting

    Hello,
    I have a question regardting converting string of numbers to the floating bumbers and plot for voltage vs. weight.
    The load cell for the ADC resolution is 16 bits, and the voltage will be in between +-5 volts.
    The problem, I have the most is converting the string of numbers to the floating numbers, in my case is the weight.
    Attachments:
    tunnelv1.vi ‏139 KB

    When you say "string of numbers" do you mean an array? What is the specific issue you are having? You seem to have orange wires running all over the place. Give a small example demonstrating the problem.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Converting String to ISO-8859-1 html charset

    i want to convert string to ISO-8859-1 html charset or vice versa
    For example i need to replace "ö" as  "&#246;"
    How can i do that?
    http://www.unicodetools.com/unicode/utf8-to-latin-converter.php

    i want to convert string to ISO-8859-1 html charset or vice versa
    For example i need to replace "ö" as  "&#246;"
    How can i do that?
    http://www.unicodetools.com/unicode/utf8-to-latin-converter.php
    This seems to return #246; but not &#246; for ö. Unless the & character is not getting displayed for some reason.
    HttpUtility.HtmlEncode Method (String)
    HttpUtility.HtmlDecode Method (String, TextWriter)
    Option Strict On
    Imports System.Web
    Imports System.IO
    Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Me.Text = "Form1"
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim myString As String = "ö"
    Dim myEncodedString As String = HttpUtility.HtmlEncode(myString)
    Label1.Text = " " & myEncodedString & " "
    Dim myWriter As New StringWriter()
    HttpUtility.HtmlDecode(myEncodedString, myWriter)
    Label1.Text &= myWriter.ToString
    End Sub
    End Class
    La vida loca

  • Unable to convert string into binary

    Hello,
    I have a web application that does the following:
    1. Takes in user information via form. This includes images.
    2. Displays all the user information in a portfolio. Looks like the portfolio on this page:
    http://wrapbootstrap.com/preview/WB00PN23G
    3. When clicking on each item you are brought to a page that displays the form information and the images.
    So far it works fine but instead of sending the images as binary to SQL database I send them as strings and the problem is now when I update the code on my cloud host the images no longer display but all the text displays fine. I am thinking the problem
    is that instead of sending my images as strings I need to store them as binary and retrieve them as well. The problem is I did some research and have been unsuccessful in the ways mentioned.
    Here is my code for the form:
    //gather all the information from the form
    //I call a stored procedure to send my data to my sql database
    using (SqlCommand cmd = new SqlCommand("SaveImage", connection.con))
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.Add("@username", SqlDbType.VarChar).Value = UserName.Text;
    cmd.Parameters.Add("@email", SqlDbType.VarChar).Value = Email.Text;
    cmd.Parameters.Add("@project", SqlDbType.NVarChar).Value = Project.Text;
    cmd.Parameters.Add("@description", SqlDbType.NVarChar).Value = Description.Text;
    cmd.Parameters.Add("@img1", SqlDbType.VarBinary).Value = img1;
    cmd.Parameters.Add("@img2", SqlDbType.VarChar).Value = img2;
    cmd.Parameters.Add("@img3", SqlDbType.VarChar).Value = ppt;
    cmd.ExecuteNonQuery();
    cmd.Parameters.Clear();
    connection.con.Close();
    //Here is the stored procedure
    USE [TestDB]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER proc [dbo].[SaveImage]
    @username varchar(100),
    @email varchar(50),
    @project nvarchar(MAX),
    @description nvarchar(MAX),
    @img1 varbinary(MAX),
    @img2 nvarchar(MAX),
    @img3 nvarchar(MAX) as
    INSERT INTO ProjectTbl(UserName, Email, ProjectName, ProjectDescription, Image1, Image2, Image3)
    VALUES (@username, @email, @project, @description, @img1, @img2,@img3)
    // Here is the code for the page that displays all the projects submitted in the form of a portfolio (just the backend not the front-end)
    public static string CreateSessionViaJavascript(string strTest)
    Page objp = new Page();
    objp.Session["controlID"] = strTest;
    return strTest;
    public static string imgString;
    //public string[] array;
    public List<string> image1 = new List<string>();
    public List<string> image2 = new List<string>();
    public List<string> image3 = new List<string>();
    public List<string> finalimages = new List<string>();
    protected void Page_Load(object sender, EventArgs e)
    if (!IsPostBack)
    LoadData();
    private void LoadData()
    var data = DataAccess.GetCurrentProject();
    try
    data.Columns.Add("hrefPath");
    foreach (DataRow dr in data.Rows)
    dr["hrefPath"] = "project.aspx?ID=" + dr["Id"];
    DataListProjectImg.DataSource = data;
    DataListProjectImg.DataBind();
    catch (Exception ex)
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    var imgButton = sender as ImageButton;
    if (imgButton != null)
    Response.Redirect("project.aspx?ID=" + imgButton.CommandArgument, false);
    //And here is the code for the each individual item that is clicked on in the portfolio. The images are displayed in a carousel along with the user entered data:
    protected void Page_Load(object sender, EventArgs e)
    //string code = "" + Session["Code"].ToString();
    projectId = Request.QueryString["ID"];
    if (!this.IsPostBack)
    LoadData();
    private void LoadData()
    Connection connection = new Connection();
    try
    connection.connection1();
    SqlCommand com = new SqlCommand("Select Image1,Image2,Image3,UserName,ProjectName,ProjectDescription,Email FROM ProjectTbl Where id='" + projectId + "'", connection.con);
    SqlDataReader dataReader = com.ExecuteReader();
    while (dataReader.Read())
    image1.Src = dataReader["Image1"].ToString();
    image2.Src = dataReader["Image2"].ToString();
    image3.Src = (dataReader["Image3"] != null && (dataReader["Image3"].ToString().Contains(".ppt") || dataReader["Image3"].ToString().Contains(".pptx"))) ? "assets/img/PPTdefault2.png" : dataReader["Image3"].ToString();
    hprPptLink.HRef = (dataReader["Image3"] != null && (dataReader["Image3"].ToString().Contains(".ppt") || dataReader["Image3"].ToString().Contains(".pptx"))) ? dataReader["Image3"].ToString() : "#";
    Name.Text = dataReader["UserName"].ToString();
    ProjectName.Text = dataReader["ProjectName"].ToString();
    Description.Text = dataReader["ProjectDescription"].ToString();
    Email.Text = dataReader["Email"].ToString();
    FillDataForEditProjectModal(dataReader);
    dataReader.Close();
    catch (Exception)
    throw;
    private void FillDataForEditProjectModal(SqlDataReader dataReader)
    UserName.Text = Convert.ToString(dataReader["UserName"]);
    txtEmail.Text = Convert.ToString(dataReader["Email"]);
    Project.Text = Convert.ToString(dataReader["ProjectName"]);
    txtDescription.Text = Convert.ToString(dataReader["ProjectDescription"]);
    protected void btnSaveProjDetails_Click(object sender, EventArgs e)
    SaveUploadedFiles();
    LoadData();
    private void SaveUploadedFiles()
    try
    //validation part
    if (Images1.HasFile)
    if (!CheckImageFileType(Images1))
    GenerateImageUploadJavascriptError("Image 1 Upload");
    return;
    if (Images2.HasFile)
    if (!CheckImageFileType(Images2))
    GenerateImageUploadJavascriptError("Image 2 Upload");
    return;
    if (Images3.HasFile)
    if (!Images3.PostedFile.FileName.ToLower().Contains("ppt") || !Images3.PostedFile.FileName.ToLower().Contains("pptx"))
    string script = "alert('Please Select PPT/pptx type only')";
    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "pptUploadError", script, true);
    return;
    //End validation part
    //uploading part
    string image1Path = string.Empty;
    string image2Path = string.Empty;
    string image3Path = string.Empty;
    if (Images1.HasFile)
    image1Path = Path.GetFileName(Images1.PostedFile.FileName);
    Images1.SaveAs(Server.MapPath(image1Path));
    if (Images2.HasFile)
    image2Path = Path.GetFileName(Images2.PostedFile.FileName);
    Images2.SaveAs(Server.MapPath(image2Path));
    if (Images3.HasFile)
    image3Path = Path.GetFileName(Images3.PostedFile.FileName);
    Images3.SaveAs(Server.MapPath(image2Path));
    DataAccess.UpdateProjectDetails(UserName.Text, txtEmail.Text, Project.Text, txtDescription.Text, image1Path, image2Path, image3Path, projectId);
    //end of uplaoding part
    catch (Exception ex)
    throw;
    //Server.Transfer("current.aspx");

    Hi compuluv,
    To store it in the Image object. This image object must be converted to a byte array.
    Based upon your code as below, please try to change Varchar to byte[].
    cmd.Parameters.Add("@img1", SqlDbType.VarBinary).Value = img1;
    cmd.Parameters.Add("@img2", SqlDbType.VarChar).Value = img2;
    cmd.Parameters.Add("@img3", SqlDbType.VarChar).Value = ppt;
    cmd.ExecuteNonQuery();
    For more detailed information, please check
    C# Save and Load Image from Database
    By the way, since your project is a web application, I also found a asp.net version as below.
    You can get some hints.
    http://www.dbtutorials.com/retrieve/saving-retrieving-image-cs/ 
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • It is possible to convert String to XMLDocument?

    I use XML SQL Utility to generate an XML document from the results of a query. I want to apply XSLT on this xml document.
    The problem is that XSU generates the document in String format. Or I use XSLProcessor.processXSL, and this method needs to parameters stylesheet and XMLDocument.
    So, my question is :It is possible to convert String to XMLDocument?
    Thanks.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
    Use getXMLDOM() instead of getXMLString() on the OracleXMLQuery object. This returns you a DOM representation instead of a string, avoiding parsing.<HR></BLOCKQUOTE>
    Hi
    I'm reading about how " generate an XML document from the results of a query" i exactly want to do this but i need to create the XML file not only generate it. How I "create" the XML file?. Because, I need to manipulate later my XML file.
    Thanks for any help.
    null

  • Converting String to boolean not working

    Hello there - I am having a bit of trouble - I am trying to write a program to evaluate boolean expressions (fully parenthesized) As StringTokenizer goes through the expression, the boolean values are being pushed (as Boolean objects) and popped (converted to String) correctly, but the expression I am using to evaluate them is evaluating false (see my debug below)
    In my current code, I have op1 and op2 coming off of the stack as Strings but am not sure if Boolean.getBoolean() is the right method to use to convert them to boolean values. The Sun docs weren't very helpful and there wasn't anything that I could find on the Sun forum about converting Strings to boolean (vs. Boolean). This is what my evaluate code looks like:
    if (operation.equals("||")) {
    opB1 = Boolean.getBoolean(op1);
    opB2 = Boolean.getBoolean(op2);
    test = (opB1 || opB2);
    System.out.println("test = (opB1 || opB2) " + (opB1 || opB2)); //debug
    System.out.println("opB1 = " + opB1 + " opB2 = " + opB2); //debug
    In the above example - using the expression "( ( 1 < 2 ) && ( 2 > 1 ) )" my debug reads like this:
    Operator added to stack is (
    Operator added to stack is (
    Operand added to stack is 1
    Operator added to stack is <
    Operand added to stack is 2
    Operation removed from stack is <
    Operand removed from stack is 2
    Operand removed from stack is 1
    Boolean operand added to stack is true
    Operation removed from stack is (
    Operator added to stack is &&
    Operator added to stack is (
    Operand added to stack is 2
    Operator added to stack is >
    Operand added to stack is 1
    Operation removed from stack is >
    Operand removed from stack is 1
    Operand removed from stack is 2
    Boolean operand added to stack is true
    Operation removed from stack is (
    Operation removed from stack is &&
    Operand removed from stack is true //NOTE: values are both true
    Operand removed from stack is true
    test = (opB1 && opB2) false //NOTE: expression is evaluating as false
    opB1 = false opB2 = false //NOTE: converted String went from true to false!!
    Boolean operand added to stack is false
    Operation removed from stack is (
    When I changed the type of opB1 & opB2 to type Boolean, and use:
    if (operation.equals("||")) {
    opB1 = Boolean.valueOf(op1);
    opB2 = Boolean.valueOf(op2);
    test = (opB1 || opB2);
    System.out.println("test = (opB1 || opB2) " + (opB1 || opB2)); //debug
    System.out.println("opB1 = " + opB1 + " opB2 = " + opB2); //debug
    I get an error that || and && can't be used on type Boolean.
    I've spent several hours on this boolean part alone - any suggestions? (BTW - sorry for the long message!)

    You're a genius!! Wow I never would have figured that one out in a million years!! BTW - can you tell me how you got your code to be so nicely formatted in the post?
    Everytime I cut and paste - it looks aweful and all of the indentations are gone...
    Thanks again!!!

  • Converting String Array -- String

    Hi All,
    I am converting String array to string using the following code:
    String[] a= ....;
    StringBuffer result = new StringBuffer();
    if (a.length > 0) {
    result.append(a[0]);
    for (int i=1; i<a.length; i++) {
    result.append(a);
    return result.toString();
    Is there is any other easy or efficient way to convert rather than the above code ?
    Thanks,
    J.Kathir

    It could have been written:
    StringBuffer result = new StringBuffer();
    for(int i=0; i<a.length; ++ i)
        result.append(a);
    return result.toString();
    Or in 1.5 lingo
    StringBuilder result = new StringBuilder(); //slightly less overhead
    for(String s : a)
        result.append(s);
    return result.toString();If you aren't picky about the format of the resulting string,
    you could use the java.utilArrays method )]toString(Object[]):
    String[] array= {"Hello", "World", "this", "is", "a", "1.5", "method"};
    String s = Arrays.toString(array); //[Hello, World, this, is, a, 1.5, method]

  • Not able to convert string attribute to number and date please help me out

    not able to convert string attribute to number and date attribute. While using string to date conversion it shows result as failure.As I am reading from a text file. please help me out

    Hi,
    You need to provide an example value that's failing and the date formats in the reference data you're using. It's more than likely you don't have the correct format in your ref data.
    regards,
    Nick

  • Returning strings from OLE2 Word object (Forms 4.5)

    Below is an example of how to return string and numeric values from OLE2 objects. In this example the OLE2 object is a MS Word document, and I want to fetch all the bookmarks in the Document into a Forms 4.5 Varchar2. To do this I first need to get the count of bookmarks.
    Getting a string property from an OLE2 object is a common OLE2 requirement but is poorly documented. This is the ONLY way it can be done, as OLE2.INVOKE_CHAR returns a single character not a string. Use OLE2.INVOKE_OBJ, then OLE2.GET_CHAR_PROPERTY which does return a string, as shown below, to return a string from an OLE object (or OLE property).
    Also note how you can only get the child object from its parent, not the grandchild (etc) object, so multiple (cascading) GET_OBJ_PROPERTY calls are required.
    /* by: Marcus Anderson (Anderson Digital) (MarcusAnderson.info) */
    /* name: Get_Bookmarks */
    /* desc: Returns a double quoted CSV string containing the document*/
    /* bookmarks. CSV string will always contain a trailing comma*/
    /* EG: "Bookmark1","Bookmark2",Bookmark3",Bookmark4", */
    /*               NB: This requires that Bookmarks cannot contain " chr */
    PROCEDURE Get_Bookmarks (pout_text OUT VARCHAR2)
    IS
    v_text           VARCHAR2(80);
    v_num                         NUMBER(3);
         v_arglist OLE2.LIST_TYPE;
         v_Application     OLE2.OBJ_TYPE;
    v_ActiveDoc      OLE2.OBJ_TYPE;
    v_Bookmarks          OLE2.OBJ_TYPE;
    v_Item                    OLE2.OBJ_TYPE;
    v_i                              NUMBER(3);
    BEGIN
              v_Application     := LDWord.MyApplication; -- Word doc opened elsewhere
                   /* Set v_num = ActiveDocument.Bookmarks.Count */
    v_ActiveDoc := OLE2.GET_OBJ_PROPERTY (v_Application, 'ActiveDocument');
    v_Bookmarks := OLE2.GET_OBJ_PROPERTY (v_ActiveDoc , 'Bookmarks');
    v_num := OLE2.GET_NUM_PROPERTY (v_Bookmarks, 'Count'); -- NB: Returns numeric property
                   /* Build the output string, pout_text. */
    FOR v_i in 1..v_num LOOP
                        /* Set v_item = ActiveDocument.Bookmarks.Item(v_i) */
    v_arglist := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG (v_arglist, v_i);
    v_Item := OLE2.INVOKE_OBJ (v_Bookmarks, 'Item', v_arglist); -- NB: returns parent object (array element)
    OLE2.DESTROY_ARGLIST (v_arglist);
                        /* Set v_text = ActiveDocument.Bookmarks.Item(v_i).Name */
    v_text := OLE2.GET_CHAR_PROPERTY (v_Item, 'Name');                    -- NB: Returns string/varchar2 property
    pout_text := pout_text || '"' || v_text || '",' ;
    END LOOP;
    END;

    Please repost in the Forms discussion forum.
    - OTN

Maybe you are looking for

  • Game Center doesn't display like it should

    I have updated my iPhone to the most recent OS version available (4.3.4). When I open the game center I only have 3 tabs - Me, Friends and Games. There should be a friends request tab but mine is missing!  The application knows I have friend requests

  • Custom bios

    paypal: 2N516531XJ5087401 Mainboard: MS-1762 PCB Version: REV:1.0 BIOS Version E1762IG6.50C BIOS Date: 8/29/2012 EC-FW Version: thanks svet. -sean

  • Secury bug in oracle 11.2.0.4.

    Hello, After perfor database import via impdp in a local Oracle Database 11.2.0.4, I noticed that I can now connect to Oracle 11.2.0.4 with the password of the remote sys and also the password of local sys. I Believe it is a security bug that must be

  • User deleted

    Hey everyone, about a year ago, I broke my arch installation and wasn't able to fix it. After several attempts, I was finally able to boot up my system again yesterday. To my surprise, I wasn't able to log in with my user account. I tried the root ac

  • Is there a alternative for 'report on reports' ??

    Hi, Oracle9i Reports no longer supports opening or saving reports to the database so i can't create a ducumentation for my reports is there a solution thank's