How to know a Word File is open.

I am opening a word file from oracle forms using webutil in the following way.
APP := CLIENT_OLE2.CREATE_OBJ('WORD.APPLICATION');     
DOCS := CLIENT_OLE2.INVOKE_OBJ(APP,'DOCUMENTS');
ARGS := CLIENT_OLE2.CREATE_ARGLIST;
CLIENT_OLE2.ADD_ARG(ARGS,V_FILE_NAME);
DOC := CLIENT_OLE2.INVOKE_OBJ(DOCS,'OPEN',ARGS);
CLIENT_OLE2.DESTROY_ARGLIST(ARGS);
CLIENT_OLE2.SET_PROPERTY(APP,'VISIBLE',1);
after that the user may close the word application.
When I try to quit word application
CLIENT_OLE2.INVOKE(app,'Quit',ARGS);
I am getting error since the application is already close by the user.
Before issuing the 'Quit' command I want to know whether the word file opened or not.
Or else I want to catch the error raised by 'Quit' command.

hi
try something like this.
DECLARE
app CLIENT_OLE2.OBJ_TYPE;
docs CLIENT_OLE2.OBJ_TYPE;
doc CLIENT_OLE2.OBJ_TYPE;
selection CLIENT_OLE2.OBJ_TYPE;
args CLIENT_OLE2.LIST_TYPE;
BEGIN
-- create a new document
app := CLIENT_OLE2.CREATE_OBJ('Word.Application');
CLIENT_OLE2.SET_PROPERTY(app,'Visible',1);
docs := CLIENT_OLE2.GET_OBJ_PROPERTY(app, 'Documents');
doc := CLIENT_OLE2.INVOKE_OBJ(docs, 'add');
selection := CLIENT_OLE2.GET_OBJ_PROPERTY(app, 'Selection');
-- insert data into new document from long item
CLIENT_OLE2.SET_PROPERTY(selection, 'Text', :long_item);
-- save document as example.doc
args := CLIENT_OLE2.CREATE_ARGLIST;
CLIENT_OLE2.ADD_ARG(args, 'c:\temp\example.doc');
CLIENT_OLE2.INVOKE(doc, 'SaveAs', args);
CLIENT_OLE2.DESTROY_ARGLIST(args);
-- close example.doc
args := CLIENT_OLE2.CREATE_ARGLIST;
CLIENT_OLE2.ADD_ARG(args, 0);
CLIENT_OLE2.INVOKE(doc, 'Close', args);
CLIENT_OLE2.DESTROY_ARGLIST(args);
CLIENT_OLE2.RELEASE_OBJ(selection);
CLIENT_OLE2.RELEASE_OBJ(doc);
CLIENT_OLE2.RELEASE_OBJ(docs);
-- exit MSWord
CLIENT_OLE2.INVOKE(app,'Quit');
END;sarah

Similar Messages

  • How to know whether a file is opened  or not ?

    Hi all,
    How to know whether a file is opened by its editor or not ? File may be any of the type.

    There are platform-dependent commands that tell whether a file (or directory, port etc.) is used by which processes.
    [oracle@izsak ~]$ fuser .
    .:                    9299c
    [oracle@izsak ~]$ ps -p  9299 -f
    UID        PID  PPID  C STIME TTY          TIME CMD
    oracle    9299  9298  0 Apr25 pts/0    00:00:00 -bash
    [oracle@izsak ~]$ ls -l $fn
    -rw-r-----  1 oracle oinstall 111215876 Apr 25 19:05 /opt/oracle/product/AS/10g/R2/opmn/logs/OC4J~ebank~default_island~1
    [oracle@izsak ~]$ fuser $fn
    /opt/oracle/product/AS/10g/R2/opmn/logs/OC4J~ebank~default_island~1:  3746  3747  3748  3749  3750  3751  3752  3753  3754  3755  3756  3758  3761  3762  3765  3767  3769  3770  3771 18638 21605 21743 21744 21745 22140 22143
    [oracle@izsak ~]$ ps -p 3746 -f
    UID        PID  PPID  C STIME TTY          TIME CMD
    oracle    3746 26427  0 Apr23 ?        00:00:01 /opt/oracle/product/AS/10g/R2/jdk/bin/java -server -Djava.security.policy=/opt...

  • How to know whether the file is opened or not

    Hi All,
    In the file handling,
    Before writing OPEN DATA SET, I want to know the file is already opened or not.
    Please help me out in this regard.
    Thanks and regards,
    Mallareddy

    Hi,
    Please try GET DATASET statement.
    Syntax:
    GET DATASET dsn.
    Extras:
    1. ... POSITION pos
    2. ... ATTRIBUTES attr
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. For details, see File Interface.
    Effect
    Used to get the properties of a file already open.
    You can use this statement without additions to determine whether the file is open.
    If the file is not open, an exception of the type CX_SY_FILE_OPEN_MODE is triggered.
    Regards,
    Ferry Lianto

  • What determines how a PDF or EPS file is opened??????

    Hi I was wondering if anyone can tell, what determines how a PDF or EPS is opened in Photoshop.
    If I open a PDF in photoshop, the first thing that pops up is the settings for which you want it to open. i.e., color mode, resolution, you choose what you want and then open.
    I always thought that how the file was created determines the initial settings in which photoshop displays in that little dialogue box. (for example, if I open an illustrator eps file that I created in photoshop, it always prompts the correct settings (300dpi, CMYK) I click open and it works great.
    But when I open a PDF in photoshop it always displays the color mode as RGB, not cmyk. Which i find odd, because I know there is no RGB color space in the PDF.
    Today something weird happend, I created an Ad in Indesign, every image I am certain was 300 dpi, and the rest are vectors. Exported it to PDF with high resolution settings, but when I opened it up in Photoshop, the settins dialogue box promted it as 72dpi, which again I find odd because I know each image is 300, the rest are vectors, and I know the PDF preset to which I exported it creates high res images.
    Does anyone know what determines how a PDF or eps file is opened in Photoshop and why photoshop is rendering a PDF in which I am certain is hi res, to a low res?
    Thanks for any help. Kevin

    >Hi I was wondering if anyone can tell, what determines how a PDF or
    >EPS is opened in Photoshop.
    Nothing, really. EPS provides this info openly in its header, but it is not always right, so PS cannot even assume it would be correct to use that info. For PDF it's a different story. PDF is a container format that can contain any number of items in mixed resolutions and colorspaces, hence PS cannot assume anything. Likewise, you can have multiple pages, links, multimedia content, all of which may influence the result upon display or rasterization...
    Mylenium

  • How to know if a file has been updated in iCloud after modification?

    How to know if a file has been updated in iCloud after modification?
    I work on various app including Keynote on my Mac Pro. And after modification, i close file and I wait.
    When I see no more Internet traffic. I assume that keynote has uploaded all the works I have done into iCloud.
    But when I open the same file on my iPad on the way to work. I do not see the file updated.
    I assume that I did not wait long enough.
    I wished I had a way to enforce the updated file to upload and way to get confirmation that it has been completed.
    In windows I simply push the sync button.
    But for iCloud I do not yet see anything like that.
    Please help.

    you would be better served asking this in the iCloud discussion, where users are more knowledgeable about iCloud. Replies on iOS and iCloud issues are usually unanswered here because of our lack of knowledge.

  • How to view corrupted word files, please help?

    Can't view doc corrupted file .How to recover unsaved documents WORD? how to view corrupted word files, please help

    It could be Word or even Windows that is having the problem. Before you start trying to restore a backup or repair a file, try opening other documents.
    Try opening your "corrupt" document from another computer. Also you can try to make a copy of corrupted files. (It could work) : http://www.filerepairforum.com/forum/microsoft/microsoft-aa/word/968-i-would-be-grateful-for-any-help-to-repair-or-the-procedures-word-files
    But if nothing helps, you can try to recover it by using DOCX Viewer Tool Download free demo versions of this software from website: http://www.docx.viewertool.com/ It’s
    gonna help.

  • How to know that URL is currenty open into other Group Tab feature ?

    Hello Firefox team,
    I use a group tab features (CTRL+SHIFT+E) and I have open many URLs in many group tab's. This URLs are on one domain because I work on one SupportTeam website and all cases/tickets have different URLs.
    I don't know that I open a duplication tab (cases/ticket) who is open in other tab or on tab in other group tab.
    How to know that URL whom I open is a duplication?.
    Best Regards
    Marcin Przysowa

    I upgrade FF to 10.0 version. The situation is the same.
    For me some information bar is perfect like:
    This URL is open in $grouptab_name.
    By click into that hint I should be jump to older tab in $grouptab_name.

  • How to know a word is a char or number

    how to know a word is a char or number??
    urgent pl

    This question has appeared many times and you could search for previous answers.
    The most popular answer is to write a function which attempts to_number(input_string). If it is not a number this raises an exception which you can handle, thus allowing the function to return true or false.

  • How do you have a file automatically open in mail, like a Constant Contact email?

    How do you have a file automatically open in mail, like a Constant Contact email?
    Thanks,
    Lauren

    If there is a way to automatically open an attached file in a Mail item, it is not one that I would use, because I want to stay in control of my Mac!  Who is it from, whats in it and so on... To me bad idea but then the choice is yours.

  • How would one convert Word files containing audio to a PC?

    I'm not sure if it's possible, but how could I convert Word files that contain audio from a Mac laptop to a PC laptop? I really would appreciate any help, as I truly need these files for academic reasons. Thank you

    Hi, theocularone -
    Welcome to Apple's Discussions.
    This particular forum is set aside for users of OS 9. Since you are using a MacBook Pro, you can not be using OS 9 (OS 9 is not usable with any Intel-processor Mac).
    You would probably get a faster, more directed response if you reposted your question in the appropriate OSX forum. Depending upon which version of OSX you are using, you can access those here -
    OSX 10.4 - http://discussions.apple.com/category.jspa?categoryID=177
    OSX 10.5 - http://discussions.apple.com/category.jspa?categoryID=235
    OSX 10.6 - http://discussions.apple.com/category.jspa?categoryID=263

  • How to know the pass ode to open apple iPad mini

    How to know the pass code to open iPad mini

    Only by remembering it - if you can't then there are insructions on this page for resetting a device : http://support.apple.com/kb/HT1212

  • How do I make Word documents to open in Word automatically after downloading the way they used to before I chose "Do this automatically with all files of this type?"

    I teach online, and my students post Word files to a Gradebook where I can click on the link and download their papers. Recently, because I got tired of having to tell Firefox what to do, I checked the box that tells it to open all Word documents with Word automatically. Now, it downloads the files, but they don't open in Word anymore, so I have to go to Downloads and open them manually. I don't know why this changed--I thought I was saving myself time. Going to Applications doesn't work--it says, when I type in Word documents (that doesn't appear in the list unless I type it), that I've chosen "Always ask." But when I click on the link, I don't get that old dialog box anymore! Help!

    See this article:
    [http://support.mozilla.com/en-US/kb/Managing+file+types]

  • How to view contents of file without opening the file?

    Does anyone know of a utility that will allow you to quickly view the contents - or a part thereof - of a file (particularly Word files) without having to open the file? I have thousands of files restored after a disk failure, but their filenames have been lost and replaced with sequential numbers. The only way of knowing the contents is to open the file, a tedious process for so many. I seem to recall seeing a shareware app that allowed this. Thanks for any help.
    MacBook Pro 17   Mac OS X (10.4.8)  

    Open the Script Editor in the /Applications/AppleScript/ folder and paste in the following:
    tell application "Finder"
    repeat with this_num from 1 to 5
    set the_item to item this_num of window 1
    set the_name to name of the_item
    set the_text to (read (the_item as alias) from 1 to 15)
    tell application "TextEdit"
    set text of document 1 to (text of document 1) & the_name & return & the_text & return & return
    end tell
    end repeat
    end tell
    Before running the script, place the folder containing the files in the frontmost Finder window; you may want to split the files between several different folders and process each folder before heading on to the next one. The numbers in blue can be customized as needed; the first one controls how many files the script will search on each run, and the other two define what part of the file will be searched. The output from a file which is in a format other than plain text may contain document formatting and other content which will look like random characters.
    (19999)

  • How do I stop word trying to open pdf docs?

    Word keeps trying top open PDFs. How do I stop it?

    Whoo hoo! That's just what we needed.
    Well, we seem to have confirmed that
    (1) Your DOCX files are opening in Adobe Reader, and
    (2) Your PDF files are opening in Microsoft Word.
    Now, we had a go at fixing this but it seems pretty tangled up. It may be better to just forget double clicking and use File > Open in Word for DOCX files, and File > Open in Adobe Reader for PDF files. If you're having trouble even doing that, let's focus on getting that bit working for you - let us know the problem. 
    (NB Because things are messed up you CANNOT rely on the icon to decide on the type of file. Use Properties to look at the file name or type).

  • How to know a jar file directory

    I have a text editor maked with Swing. All code of my program is inside a myProgram.jar
    When a user click on a txt file, this file is open with myProgram.jar.
    When myProgram start it's create a properties file.
    This properties file is created with this code:
    String path = System.getProperty("user.dir") + File.separator + "MyFile.txt";
    File f = new File(path);
    The path is not the path which i want. The properties file must create in the same dir where is stored myProgra,.jar and not in user.dir. How i can know which is the dir where the jar is stored?
    path = ?

    You're getting a null because the class file cannot be located. In other words, you haven't provided the correct info or the info in the correct format. Use the jar command with the xfv options to get the proper info. For example:
    jar -xfv myProgram.jar
    where myProgram.jar is the name of your jar file.
    In the following example, if I wanted the URL for Chart.gif under a subdirectory named images, I would do this:
    URL jarPath=this.getClass().getClassLoader().getResource("images/Chart.gif");
    D:\AOKabc\prod>jar -xvf aokabc.jar
    extracted: images/Chart.gif
    extracted: images/Tile.jpg
    extracted: images/Back_.gif
    extracted: images/Forward_.gif
    extracted: images/invalid32x32.gif
    extracted: images/image-failed.gif
    extracted: SysParams.properties
    Ok?
    ;o)
    V.V.

Maybe you are looking for