Get WORD Options with OLE

I am trying to get the default WORD startup path with OLE but I cannot seem to get properties from the Options object.  Sometimes it is empty.  The results are inconsistent.  Here is my code.
    INCLUDE ole2incl.  "contains one line: TYPE-POOLS OLE2 .
    DATA: o_WORD       TYPE ole2_object,
          o_doc        TYPE ole2_object,
          o_options    type ole2_object,
          o_defPath    type ole2_object,
          wa_ver       type string,
          wa_ver2      type string,
          wa_ipar      type i,
          wa_stpar     type string,
          wa_startup   type string
    CREATE OBJECT o_WORD 'word.application'.
*-- Run in background
    SET PROPERTY OF o_WORD 'visible' = 0.
*-- these calls work fine.  Not sure why Call and Get work the same.
    CALL METHOD OF o_WORD 'Version' = wa_ver.
    GET PROPERTY OF o_WORD 'Build' = wa_ver2.
*-- this call sometimes works but not always
    CALL METHOD OF o_WORD 'Options' = o_options.
*-- none of the following seem to work
    CALL METHOD OF o_options 'Parent' = wa_stpar.
    CALL METHOD OF o_options 'DefaultBorderColor' = wa_ipar.
    CALL METHOD OF o_options 'DefaultFilePath' = wa_startup
      exporting
        #1 = 'wdStartupPath'.
   GET PROPERTY OF o_defPath 'wdStartupPath' = wa_startup.
*VBA code:  wa_startup = Options.DefaultFilePath(Path:=wdStartupPath)
Close word (no data needs to be saved)
   call method of o_workbook 'CLOSE'.
    call method of o_WORD 'QUIT'.
    free object o_doc.
    free object o_WORD
Anyone have any ideas?
thanks in advance,
Olivier

The following program is working fine for me. It returns all four values including the full file path.
================================================
INCLUDE: ole2incl.                   " Ole data types
DATA: o_word        TYPE ole2_object,
      wf_documents   TYPE ole2_object,
      wf_document    TYPE ole2_object,
      wf_options     TYPE ole2_object,
      wf_selection   TYPE ole2_object,
      wf_window      TYPE ole2_object.
DATA: wa_filepath    TYPE string,
      wa_bordercolor TYPE i,
      wa_version     TYPE string,
      wa_build       TYPE string.
DATA: wf_crlf1       TYPE x VALUE '0B'.
DATA: wf_crlf2       TYPE x VALUE '0D'.
DATA: wf_new_text    TYPE string .
CREATE  OBJECT   o_word           'Word.Application'.
SET PROPERTY OF o_word 'VISIBLE' = 0.
GET PROPERTY OF o_word 'Version' = wa_version.
GET PROPERTY OF o_word 'Build'   = wa_build.
GET PROPERTY OF o_word 'Options'  = wf_options.
GET PROPERTY OF wf_options 'DefaultBorderColor' = wa_bordercolor.
GET PROPERTY OF wf_options 'DefaultFilePath'    = wa_filepath
  exporting
    #1 = 8.
CALL METHOD OF o_word 'QUIT'
  EXPORTING
    #1 = 0.     " SaveChanges-No
WRITE: /5 'Version:',      20 wa_version.
WRITE: /5 'Build:',        20 wa_build.
WRITE: /5 'BorderColor:',  20 wa_bordercolor.
WRITE: /5 'File Path:',    20 wa_filepath.
===================================================
The output is:
  Version:       11.0                                                                           
  Build:         11.0.8134                                                                      
  BorderColor:   16,777,216-                                                                    
  File Path:     d:\documents and settings\arimilrn\application data\microsoft\word\startup                                                                               
Regards,
Rao A

Similar Messages

  • Opening Word document with OLE

    Hello,
    I must have a case of own-code-blindness, could anyone see what the problem is? A blank document is created but I can't get it to load the file...
    <snip>
    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');
    args := CLIENT_OLE2.CREATE_ARGLIST;
    CLIENT_OLE2.ADD_ARG(args, 'd:\foo.doc');
    CLIENT_OLE2.INVOKE(doc, 'FileOpen', args);
    </snip>
    aTdHvAaNnKcSe

    Thanks, I am able to setup webutil.
    Now I have other problem in context of migrating OLE functionality using Webutil. I have an OLE Container item 'OLE_FIELD' in block 'Blk_name' which contains a word document. 'OLE_FIELD' corresponds to a long raw column in the table . I want to put the contents of this into a newly created word document and run a macro on this document. This was done using Forms_Ole.Activiate_Server, Forms_Ole.Execute_verb earlier. Can someone let me know how this is achieved in 9iDS using Webutil since 9iDS does not support the ole container? I am sending the code as it was in earlier version of Forms.
    Declare
    arglist OLE2.LIST_TYPE;
    application OLE2.OBJ_TYPE;
    BEGIN
    FORMS_OLE.ACTIVATE_SERVER('Blk_name.OLE_FIELD');
    application := OLE2.CREATE_OBJ('Word.Application.8');
    -- Open the embedded document for editing
    FORMS_OLE.EXEC_VERB('Blk_name.OLE_FIELD',1);
    -- Run Macro for document
    arglist := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(arglist, 'MACRO_NAME.MAIN');
    OLE2.INVOKE(application, 'Run', arglist);
    OLE2.DESTROY_ARGLIST(arglist);
    OLE2.INVOKE(application, 'Quit');
    -- Close Word
    FORMS_OLE.CLOSE_SERVER('Blk_name.OLE_FIELD');
    -- Release the OLE object
    OLE2.RELEASE_OBJ(application);
    END;
    Thanks in advance,
    Ravi

  • HT1848 I am trying to transfer my purchases from my iPhone 5 to my new Mac computer.  I get the message stating that it can only be synced with one computer at a time.  I have tried the 2 other ways and I get no options to transfer my purchases.  Help?

    I am trying to transfer my purchases from my iPhone 5 to my new Mac computer.  I get the message stating that it can only be synced with one computer at a time.  I have tried the 2 other ways and I get no options to transfer my purchases.  Help?

    If you see Devices in the big list on the left-hand side of iTunes, it should show the name of your iPhone right below it. You can right-click (or hold ctrl and left click) on the name of the iPhone there, and choose "transfer purchases from iPhone".
    If you're on iTunes 11, you won't see the big list of the left until you go to the View menu at the very top (where you see iTunes/File/Edit/View/etc) and choose Show Sidebar. Then do the same thing: right-click or ctrl and left-click on the iPhone's name below Devices and "transfer purchases from iPhone".
    It'll ask you to authorize the computer for your Apple ID if you haven't yet; to do that, you just type your Apple ID and password in when it asks. If it says you are not authorized but doesn't automatically give you an option to do so, then you can go to the Store menu at the very top and choose "authorize this computer".

  • How do i get the "open with" option back for pdfs after accidentally hitting the save option which now automatically saves any pdf?

    Normally when I click on a pdf I would get an option to "Open With" or Save. I usually just opened pdfs first. I accidentally clicked on the Save option in this dialog box and now when I click on any pdf it automatically asks me where I want to save it. I want to get the "open With" option back, because I don't necessarily want to save a copy of every pdf.

    Mountain Lion was released in 2012, so I suppose there might be advice in old threads or on the Apple forums if you don't get a response here right away.

  • Not getting correct signing options with Reader XI

    I orignally asked this question in the Reader forum and it was suggested that I ask it over here. The problem may be related to reader settings or something that I'm unfamiliar with.
    I've been beating up this problem for a while.
    Created a form using Acrobat Pro XI and added two signature fields. The intent is to use this to have a customer sign a workorder with a stylus and a touch screen PC carried by my employee. I need the "place a signature" option.
    Problem: I get different options on two different computers. The one with Pro and the Reader installed gives the the options I want. The one with just the Reader installed only gives me "Work with Certificates" signing option.
    The form is saved "Reader Extended" and it doesn't matter, I still don't get the options to "place a signature" if I save it with the "reader extended" options or not.
    If I set it up as an EchoSign enabled form, I get the exact same results.
    Here is a screen shot of the options from the computer with just the reader installed. You can see I have no signing options aside from the "Work with Certificates" options.
    Here is a screen shot from the other computer that has both the reader and acrobat pro installed. It gives me the ability to palce a signature.
    Here is a sample form.
    Thanks for any help and guidance you have.

    Hi George, here is a sample form that is not reader-enabled and has no signature field. 
    With both forms, when I open them on the PC that only has Reader XI installed on it, the only group of options I get under the sign feature is the "Work with Certificates" group. For the reader enabled form, it will lets me sign using a certificate. With the form that is not reader enabled, all options are grayed out.
    If I use the PC that I have both Acrobat Pro XI and the Reader XI installed on, when I open the form with the reader, I get the options that I would expect as shown in the original post.
    I looked through all of the preference settings in Reader to see if there was someplace I could enable the "I need to sign" group of options or something like that and I don't find anything.
    Here is the same forms with signature fields added and I get the same results. This one is reader-enabled and this one is not.
    Thanks again.

  • When I receive calls I always get the option to remind me later, but only certain times I get the option to respond with text.  Is there a setting I need to update to always get this option?

    When I receive calls I always get the option to remind me later, but only certain times I get the option to respond with text.  Is there a setting I need to update to always get this option?  Also i can't use location reminders.  Is this because my calendar is in Outlook?

    The only known way to make it work on an external drive is by first installing Windows onto an internal drive, then cloning the install to an external Thunderbolt drive. Thunderbolt is seen as an extension of the internal bus, so Windows doesn't see it as an external device.

  • I have been offered cc 2014 for 29.99 and its says contact the support team to see if I qualify - trying to get to the support team option by telephone just seems to send me in a loop - getting pretty disgusted with all the rigmarole just to get a somethi

    I have been offered cc 2014 for 29.99 and its says contact the support team to see if I qualify - trying to get to the support team option by telephone just seems to send me in a loop - getting pretty disgusted with all the rigmarole just to get a something

    This is an open forum, not Adobe support... you need Adobe staff to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"
    -or by telephone http://helpx.adobe.com/x-productkb/global/phone-support-orders.html

  • I am trying to save a photoshop CS6 psd file to jpg and get an option jpg, jpg2000 or jpg stereo, I choose jpg and then Mac 256 colours, normal or interlaced.  I just want regular jpg with a high resolution.  What am I doing wrong, never had this problem

    I am trying to save a photoshop CS6 psd file to jpg and get an option jpg, jpg2000 or jpg stereo, I choose jpg and then Mac 256 colours, normal or interlaced.  I just want regular jpg with a high resolution.  What am I doing wrong?  , never had this problem before.  Help!!! 

    Your description of the issue is not clear:
    What format, bit depth and color was your original file "from the net"?  It sounds like it was a Color Indexed GIF, which would cause what you are describing.
    In the Macintosh Finder, select said "net image" and do a Get Info on it (Command+i). When the Info box appears in the Finder, take a screen shot and upload it here by using the little camera icon in the Reply Editor in the forum's web interface.
    If the image is a 256-color GIF, remember the rule:  GIGO = garbage in, garbage out.

  • My maps are not showing buildings with clarity. They have no color. It's like my maps are outdated but my ipad is fully updated. I can't get the option of views in my ipad

    My maps are not showing buildings with clarity. They have no color. It's like my maps are outdated but my ipad is fully updated. I can't get the option of views in my ipad. Like the downtown view and stuff. Please help.

    What locations are you seeing these "problems"? If the satellite photos are older or not as clear, you may see some of what you describe. Take a look at one of the major cities and see if they are also appearing as you describe. Someplace like New York, London, Paris. Those are among the cities that seem to be updated most frequently.
    Incidentally, the maps are web/cloud based and not contained within the maps app on your iPad, so regardless of the version of your app, you will still get the most current map available.

  • Not Getting "Undock" Option in Windows 7 with W520 in Docking Station

    I just bought a W520 which is my 5th ThinkPad in about 10 years.  This one is different in that I don't get the option to "Undock" in the Windows 7 "Shutdown" option list.  I also noticed the W520 doesn't seat as securely into the docking station as my prior ThinkPads, but the docking station ports all work correctly.
    Is there something wrong with my hardware or Windows 7 settings?

    Hi all
    I guess, this article would help
    http://social.technet.microsoft.com/Forums/en-US/w7itproinstall/thread/94468d2b-4ae8-4228-90a6-2c5ae...
    If the undock option is not available, you could just put your laptop into sleep mode (or simply close the lid by default) and just undock the docking station from it. Resuming from sleep mode does not take much time either.
    Have a nice day! 
    Peter
    W520 (4284-A99)
    Does someone’s post help you? Give them kudos as a reward, as they will do better to improve | Mark it as solved if the solution works for you, so it could be reference for others in the future 
    =====================================
    Sound Enthusiast and Enhancement (Post comments, share mixes, etc.)
    http://forums.lenovo.com/t5/General-Discussion/Dolby-Home-Theater-v4-for-most-Lenovo-Laptops/td-p/62... 

  • HT1918 How do you solve an issue with the card? I don't get the option of 'none' :(

    How do you solve an issue with the card? I don't get the option of 'none'

    I had this exact same problem with the new iPhone I bought on 1/4/13. The walk through they provide on how to do this is useless because it fails to explain that if you are already having the problem of not getting the "None" payment option with an Apple ID then you will need to create a completely new Apple ID.
    I had to do this 7 times since I bought my iPhone on Friday until this morning to figure out how to finally be able to use the Home Sharing option in iTunes to put my music collection on my brand new $500.00 iPhone. Pretty pathetic if you ask me but since it made me so angry I want to make sure other know how to do this so you don't get as upset as I did.
    #1 If your current or soon to be "old" Apple ID is not providing the option for "None" as a payment option then you need to make a brand new one. But you have to make it specifically how I tell you.
    #2 You will need to use an email address that has not already been used for anything related to a previous Apple ID. You might need to make a brand new email address.
    #3 Open iTunes, then open iTunes Store (upper right corner of iTunes).
    #4 Click on App Store (upper center of screen).
    #5 Scroll down the screen page until you see Top Free Apps on the right side.
    #6 Choose any one of the FREE apps.
    #7 You should either get the option to create a new Apple ID box, either that, or it will pop up with some kind of disclaimer and then it does the create new Apple ID.
    Either way just create a new Apple ID when it gives you the option to and then when you get to the page that looks like the payment page the "None" payment option will finally be available.
    Note: You will still have to fill out the information on the payment page. As long as you choose the "None" option it will not request any credit card information.
    #8 You will be sent a confirmation email to the new email account. Just follow through with what ever it tells you and viola now you can use your Apple Device.
    What a pain in the keester, eh?

  • When i connect i5 to itunes .. i dont get "delete" option for songs upon right click .. can anyone help me with this plz?

    when i connect i5 to itunes .. i dont get "delete" option for songs upon right click .. can anyone help me with this plz?

    Yes, annoying. A couple of options:
    While it's playing the current A song, click on the H song to select it (but not double click to play it), when iTunes jumps to the second A song, press the down key and iTunes will remember that you had that H song selected and will move the selection to the second H song while the second A song is still playing. So, still jumps around, but easy to get back to where you were.
    Create a new playlist for your music, right click on it, select "New Window" and you can browse your music in a second list while the first window continues to play music. But if you then start playing music in that second window, you have to go back to the first window if you want to start browsing again. Not great if you're navigating around to play the next song.
    Play music from iTunes DJ, then as you're browsing around your library, you can add things to play next in DJ, and go back. You can combine this with previous suggestion, to keep DJ open in one window while you browser in the other window.
    None of these are great, but maybe one of these works better than your current workflow.

  • HT3986 I have a Macbook Pro, have recently upgraded to OS 7, have installed the bootcamp option, and am not getting any sound with using windows applications.

    I am getting no sound with I use windows programs on my Macbook Pro. I am operating with the bootcamp option. The sound works fine with I am running the MAC OS 7
    I read that my problem could be a driver, but I am unsure how to get this driver and how to install it.

    Read the Boot Camp installation guide http://manuals.info.apple.com/en_US/boot_camp_install-setup_10.7.pdf. You download the drivers during the installation process. Then you install the downloaded drivers after booting into Windows. You can also go to the source to get the sound drivers for your comuter. Search this forum and you will find posts with the url  from which to download the drivers.

  • HT2731 I am using ipad2 with the latest version. While trying to make a apple Id, In the payment information  cannot get the option of "none" what will I do. Please help.

    I am using ipad2 with the latest version. While trying to make a apple Id, In the payment information  cannot get the option of "none" what will I do. Please help.

    You are following the instructions on this page for creating a new account : http://support.apple.com/kb/HT2534 e.g. selecting a free app in the store and tapping on 'create Apple id' when 'buying' the app ? I've just tried it and it works for me

  • Hi i use iphone 4 with iso 6.1.3!! Am not getting an option to register my phone number in imsg!! Am just getting an option to set my email address for sending and receiving the imsgs!! How do i register my phone number??

    Hi i use iphone 4 with iso 6.1.3!! Am not getting an option to register my phone number in imsg!! Am just getting an option to set my email address for sending and receiving the imsgs!! How do i register my phone number??

    Hello Nikkii,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    iOS: Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/ts4268
    Troubleshooting telephone-number activation (iPhone only)
    After each step, toggle FaceTime and iMessage off and then on in Settings > Messages and Settings > FaceTime.
    Update to the latest version of iOS.
    Ensure that your iPhone is set to the correct time zone. Tap Settings > General > Date & Time.
    Note: If Set Automatically is on but the incorrect time zone is displayed, turn Set Automatically off and then choose the correct time zone, date, and time. Then turn Set Automatically on again.
    Ensure that FaceTime has not been restricted: Settings > General > Restrictions > FaceTime.
    Verify that you can send SMS messages. You need a valid SMS messaging plan to activate FaceTime.
    Contact your carrier to verify that there are no restrictions or blocks on text messages. Blocks on text messaging will prevent iMessage and FaceTime registration.
    If you are unable to activate iMessage or FaceTime on a device after remote wiping it, wait at least 24 hours and try again.
    If "Waiting for Activation" is displayed, leave FaceTime and iMessage enabled for 24 hours. Toggling FaceTime or iMessage off and on will cause the registration process to start over.
    Best of luck,
    Mario

Maybe you are looking for