Ole2 question about inserting document object in Word

I thought I had it figured out but it doesn't seem to work. From a Oracle Forms 6i application, I want to insert an object(a file) in a word document as an icon.
The vb code generated when I record the macro of inserting an object as an icon is:
Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.8", FileName _
:="string defining the location of the file object", LinkToFile:=False _
, DisplayAsIcon:=True, IconFileName:= _
"C:\WINDOWS\Installer\{90110409-6000-11D3-8CFE-0050048383C9}\wordicon.exe" _
, IconIndex:=1, IconLabel:= _
"string defining the location of the file object"
Using this I wrote the following code: ( I am leaving out the declaration of the ole2.obj_type and other variables)
args := ole2.create_arglist;
ole2.add_arg (args, 'string defining the location of the file object');
hinlineshapes :=
ole2.get_obj_property (hselection, 'InlineShapes');
ole2.invoke (hinlineshapes
,'AddOLEObject'
,args
ole2.destroy_arglist (args);
holeformat := ole2.get_obj_property (hinlineshapes, 'OLEFormat');
ole2.set_property (holeformat
,'ClassType'
,'Word.Document.8'
ole2.set_property (holeformat
,'DisplayAsIcon'
,TRUE
ole2.set_property (holeformat
,'IconLabel'
,'string defining the location of the file object'
When I run the code I get the following message from MS Word:
" This object was created in 'string defining the location of the file object'.
This application is not available to open this object.
Make sure the application is properly installed and that it has not deleted, moved or renamed."
Can someone please help? Thanks in advance.

Second, when it inserts the date, it makes it an "update automatically" date that updates to the current time every time I open the document
Sure, that's because you specifically tell it to. Your script inserts a 'new field' which is analogous to Word's dynamic text objects (date, time, page number, etc.)
Instead, what you want to do is insert an actual string of characters - sure, to you and I that string of characters might look like a date and time, but to Word it's nothing more than a series of characters.
For that we can fall back on AppleScript's date features, specifically current date, like:
tell application "Microsoft Word"
  tell selection
    type text text "Left message " & (current date as text)
  end tell
end tell
Note that current date as text returns a rather verbose form of the date. If that's too much for you there are alternate options, such as:
short date string of (current date) & space & time string of (current date)
which will look more like: "6/10/10 3:26:50 PM"
But there is also a myriad of other ways (with seconds, without seconds, 12/24 hr, etc.) depending on what you want.
Third, if possible, I would also like it to be in italics.
I'll have to look at that one, unless someone else beats me to it.

Similar Messages

  • Question about inserting Sysdate (SQL)

    Hi all,
    I got a question about records insert when one of the fields is sysdate.
    I have to store several records representing a log, generated by the execution of a database package.
    Inside my package I wrote an internal procedure devoted to insert a record in my log table for each processing step I wanted to trace (I call this proc each time I want to record a certain step of my package).
    My log table structure is: PREC_LOGS(log_date DATE, log_message VARCHAR2(1000)), no constraints at all.
    Database ver. 8.1.7.1.0 - Production for VMS O.S.
    The 'problem' occurs when several records have the same sysdate (DD-MM-YYYY HH24:MI:SS). In this case, if I select log_date,log_message ... order by log_date, the list of records I get respects the sort condition, but when several records have the same sysdate (DD-MM-YYYY HH24:MI:SS), it doesn't respect the order of the steps theoretically inserted by the internal proc.
    Resault
    25-07-2002 11:10:20 ........ (date changed)
    25-07-2002 11:10:22 Loading data for order nr. 82364 (step 3)
    25-07-2002 11:10:22 Verifying order nr. 82364 (step 2)
    25-07-2002 11:10:22 Procedure started for order nr. 82364 (step 1)
    25-07-2002 11:10:22 Updating conditions for order nr. 82364 (step 4)
    25-07-2002 11:10:22 Procedure accomplished for order nr. 82364 (step 6)
    25-07-2002 11:10:22 Commit changes for order nr. 82364 (step 5)
    25-07-2002 11:10:24 ........ (date changed)
    Please ask for more detail if someone is interested in replying...I realize it's not a very clear explanation of my issue.
    Thanks, Marco

    Hi
    Add a field to the table that is that uses a sequence
    PREC_LOGS(log_id NUMBER(30),log_date DATE, log_message VARCHAR2(1000))
    Create a database sequence
    The insert statement now becomes something like
    INSERT INTO PREC_LOCS(log_id, log_date, log_message)
    VALUES (sequence_name.NEXTVAL, SYSDATE, 'Some message');
    Then order by the log_id when you do your select.
    Daniel

  • Unable to insert PDF object into Word 2013

    Hi,
    While trying to insert PDF (Adobe Reader X 10.1.0) document into Word
    (Microsoft office Professional plus 2013 15.0.4420.1017) getting below error.
    Error Message: The Program used to create this object is
    Acroexch.That program is either not installed on your computer or it is not
    responding, to edit this object , install AcroExch to ensure that any dialog
    boxes in Acroexch are closed
    Also i tried mentioned steps:
    Step1: Open Adobe Reader and goto Edit ==> References (ctrl+k).
    Step2: In General uncheck the Enable protected mode at startup.
    But still getting the same error.
    Any suggestion Please!!!!!!!
    Thanks in advance.

    gkrish wrote:
    (Adobe Reader X 10.1.0)
    I would try to install a newer Reader version; either 10.1.10 or 11.0.07.

  • How to insert ole object like word doc at runtime

    To insert word doc into crystal report

    Hi Vinod,
    To add an OLE object in reports follow the steps given below-
    1- In CR environment open a Report in which OLE object needs to be added.
    2- Click on insert and click on OLE object.
    3- A wizard pops up - choose appropriate file for e.g- Microsoft World Document.
    4- two buttons will be there-
    a> Create new - creates a new world document.
    b> Create from new - Includes a exsisting file.
    5- one more option is their in wizard -
    Show icon(check box) - shows the OLE object as an icon in report.
    6- Click on ok and place the object at required position in report.
    Hope it works.
    Regards
    Amit

  • A question about insert?

    if the two applications want to insert the same data into database at the same time? but I only expect one application execute successful.
    how do I prevent insert the same data into database?

    if the two applications want to insert the same data
    into database at the same time? but I only expect one
    application execute successful.
    how do I prevent insert the same data into database?This is not an advanced language topic and the language is
    barely English, but allright. Here goes;
    To prevent the insertion of equivalent data into the same
    database you should find out about your database's transaction
    mechanisme (if it has one). If it doesn't you should look
    into mutual exclusion points in your client code.
    What I mean is, that you want to examine before you insert,
    and do this inside a protected timewindow. This can be achieved
    inside your database with the use of transactions, or it can
    be achieved inside your client code (if you're the only client
    to that database and both calls live inside the same JVM)
    by synchronization.
    in pseudo code:
    static Object mutex = new Object();
    synchronized (mutex) {
      Object[] result;
      result = sqlselect("select * from table where foo=bar;");
      if (result.length == 0) {
        sqlinsert("insert into table (foo="bar");");
    }

  • A question about the create object command

    Hi, I met some problems when created type and view:
    In sqlplus,
    1) I first create a address_ty:
    create or replace type address_ty as object
    (street varchar2(50),
    city varchar2(25),
    state char(2),
    zip number);
    type created
    2) Then I created a person_ty;
    create type person_ty as object
    (name varchar2(25),
    address address_ty);
    type created
    3) create the table customer;
    create or replace table customer
    (customer_id number,
    person person_ty);
    table created
    4) create the view based on the customer table;
    create view customer_0v(customer_id, person) as
    select customer_id,
    person_ty(name,
    address_ty(street,city,state,zip))
    from customer;
    ***There is a error message :
    error at line 4: address_ty(street,city,state,zip))
    invalid column name.
    I think it should work but ...
    5) Another question is could I insert into table customer values like this:
    insert into customer values
    (123,'SIGMUND','47 HAFFNER RD','LEWISTON','NJ',22222);
    It does not work in my pc and give a erro message like ' too many valuesj'.
    But some of books said it works.
    Thanks for any help !
    echo
    null

    Why does not the Object itself implement the interface
    CloneableBecause then every object would be cloneable.

  • Question about insert date value from xml file

    I want insert value into table from xml file. Every time I inserted value of date type into the table, I got the unpasable error message as following:
    oracle.xml.sql.OracleXMLSQLException: Exception 'java.text.ParseException:Unpars
    eable date: "2000-04-19 00:00:00.0"' encountered during processing ROW element
    Thanks for anyone that can fix my problem or give me any suggestion.
    email: [email protected]

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by matmnwx:
    I want insert value into table from xml file. Every time I inserted value of date type into the table, I got the unpasable error message as following:
    oracle.xml.sql.OracleXMLSQLException: Exception 'java.text.ParseException:Unpars
    eable date: "2000-04-19 00:00:00.0"' encountered during processing ROW element
    Thanks for anyone that can fix my problem or give me any suggestion.
    email: [email protected]<HR></BLOCKQUOTE>
    Use:
    OracleXMLSave sav = new OracleXMLSave(conn,tabName);
    sav.setDateFormat(<hier the date format in the XML-File>);

  • Question about using file objects

    Hi,
    I have two somewhat related issues in using file objects.
    In one app, a simple swing gui that passes a file to a sax parsing class and reports back any errors, if I parse a file using the app, then try to edit the file I'm parsing (in another application) and save, I get an error message. I need to close the parsing app before I can save the file.
    In another app I wrote, one that takes a group of files and runs an xslt stylesheet on them, if I select too many files, I get an OutOfMemory error, which leads me to believe that as the files go through multilple processes, they stay alive on the heap.
    a file object is basically just a pathname, right? If I'm not using a BufferedWriter, or InputStreamReader or whatever, you can't really close a file...will the notifiy() method let the jvm know that it can let go of the file?
    thanks,
    bp

    A File object is just a path, it doesn't open the file or lock it, etc.. But if you are parsing the file, you must be opening (and forgetting to close it).

  • Question about creating new objects

    When creating a DocumentBuilderFactory Object, why is the code written like this:
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();as opposed to
    DocumentBuilderFactory docBuilderFactory = new DocumentBuilderFactory();???

    Factory classes like this are typically abstract classes which do little more than define an interface and the getInstance() methods. The class that getInstance() will actually instanciate will be a concrete implementation from a particular implementation of the DOM parser. This pattern allows whatever implementation happens to have been supplied to be automatically be used without your code having to concern itself.
    The concrete factory will then create concrete implementations of the various interfaces like DOMPaser, using the implementations in the actual library.

  • Questions about erasing an object from a picture

    How does one erase something from a picture???? Something as basic as this should be easily explained but it is not in Photoshop.
    #2 How do you change the color of a sky to make it blue rather than white???

    How does one erase something from a picture???? Something as basic as this should be easily explained but it is not in Photoshop.
    Duplicate the background layer
    Work on the backgrouind copy layer, and shut off the visibility of the background layer by clicking on its eye icon in the layers palette.
    Use one of the selection tools (e.g. selection brush, lasso tool) to select the object that you wish to remove. Once the selection is complete, you will  see "marching ants" surrounding the selection. Hit delete on the keyboard.
    Now fill the hole with whatever you want.
    #2 How do you change the color of a sky to make it blue rather than white???
    You can use the Smart brush tool, the one with the gears, for this purpose.
    There are other ways as well. Please review this comprehensive thread that pertains to this issue, esp. the referenced Alibony technique:
    http://www.elementsvillage.com/forums/showthread.php?t=79424

  • Question about SNRO - Range objects

    Hi experts,
    i've created a object range from SNRO, and configurate it an interval. But i need Objet works with parameters. For example BUKRS and GJAHR.
    For each BUKRS/GJAHR, i need the range's inverval restart, or has its particular counter.
    is this possible?
    thanks..
    Edited by: Renato Calderon on Mar 18, 2010 11:25 PM

    check this link. it might be helpful to you.
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=50004015
    thks
    Abhi

  • Question about the Timer Objects

    According to the API docs, the method Schedule for a Timer object takes the following constructor:
    schedule
    public void schedule(TimerTask task,
    Date time)
    Schedules the specified task for execution at the specified time. If the time is in the past, the task is scheduled for immediate execution.
    Parameters:
    task - task to be scheduled.
    time - time at which task is to be executed.
    Source: [link]http://java.sun.com/j2se/1.4.2/docs/api/java/util/TimerTask.html[link]
    However, I am getting the following error:
    The method Schedule(TimerTask, Date) is undefined for the type Timer.
    Any idea why I would be getting this message?

    However, I am getting the following error:
    The method Schedule(TimerTask, Date) is undefined for
    the type Timer.
    Any idea why I would be getting this message?Yeah. Could be 2 things:
    1. It's "schedule" not "Schedule" (case matters)
    2. You're using java.sql.Data instead of java.util.Date.

  • Question about transfering documents to new mac

    If i had bought a new mac i was wondering if there was a way to transfer all my music and documents from my old one to my new one possibly through USB or some easy way. Doesnt matter how it gets done but as long as it is safe and easy. please let me know.

    This article explains the best way to do it.
    Target Disk Mode is another solution.
    Either way you'll need a 6-pin to 6-pin FireWire cable.

  • Question about "java.lang.Object.equals()".

    public class TestEquals {
      private int a;
      private int b;
      public TestEquals(int a,int b) {
        setA(a);
        setB(b);
      public int getA() {
        return a;
      public void setA(int a) {
        this.a = a;
      public int getB() {
        return b;
      public void setB(int b) {
        this.b = b;
      public static void main(String[] args) {
        TestEquals te01 = new TestEquals(1,2);
        TestEquals te02 = new TestEquals(1,2);
        System.out.println("te01 equals to te02: " + te01.equals(te02));
        te01.setA(2);
        System.out.println("te01 equals to te02: " + te01.equals(te02));
    }The result is:
    te01 equals to te02: false
    te01 equals to te02: false
    Why the first case is false?

    You didn't override Object.equals() in your TestEquals class. So, you are calling Object.equals(), which just compares reference values. You need to write your own equals() method (presumably, make sure te01.a==te02.a and te01.b==te02.b). Depending on what you do with your objects, you would want to override Object.hashCode(), too.

  • Some questions about the carousel object

    Hello,
    I think it is not possible to configure a non circular carousel, isn't it?, i.e., I want a carousel with 13 cells, but when the user is viewing the cell 13 I don't want the cell 1, cell 2, and so on to be viewed as the next ones.
    If this is not possible, I am thinking this:
    The user can see 5 cells (I am using an horizontal carousel) and the focus is in the 3rd cell. What I want to do is when the focus is in the 3rd cell, the user can't move to the cell in its left. Is this possible? The user only can move to the cells in the right until he reaches the third from last.
    Is this possible?
    Thanks in advance!!

    Hi jkhan!
    Thanks a lot for your reply!
    I'm trying the carousel view as a kind of timeline and the curved effect it provides I can't get it with the gallery view.
    If I could disable the carousel movement in a direction when I reached a cell it would be perfect...

Maybe you are looking for

  • Problem with Crystal reports for Eclipse and Postgres-databases

    Hi, Is there a known problem when using a PostgreSQL-database to create a report with Crystal reports Plugin? When I drag a table, then occurs a error-windows, that the object can't  created. I have found a workaround for solving the problem. After n

  • How to bring my files back from time machine

    I just got a new hard drive as the old one broke down .. I installed the snow leopard and then the Lion as i was running before .... How can i restore the computer from time machine back ups ? i have lots of data in time machine that needs to came ba

  • Stream 7, dual boot, windows and android

    Given that the HP Stream 7 can be equipped with lots of storage, why not dual boot it with Window and Andoid so I can have the best of both worlds can this tablet be configured to do that?

  • Another error 1603!!

    So after reading a lot about this nasty error, and trying everything I could lay my eyes on, and to the point to thinking about reinstalling my windows vista, which happen to be the same time as I had a windows 7 copy laying around, anyway, after all

  • Please Help! No Audio on half of my DVD!

    Hello. I created a project in iMovie. I didn't do much, just digitized my clips and imported into iDVD. Once in iDVD I created a menu and a slideshow. For the slideshow, I had it "fit to audio" with no transitions. (This is a DVD of a wedding I did)