SAP OLE to Word Usage of Text Boxes & Arrow Diagrams

hi this my Macro recording in MS word How to use this as sap Code using SAP OLE
' Macro recorded 3/30/2009 by Nirmala
    ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 216#, _
        72#, 108#, 54#).Select
    Selection.ShapeRange.TextFrame.TextRange.Select
    Selection.Collapse
    Selection.TypeText Text:="Hma"
    Selection.ShapeRange.Select
    ActiveDocument.Shapes.AddLine(207#, 135#, 261#, 207#).Select
    Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadTriangle
    Selection.ShapeRange.Line.EndArrowheadLength = msoArrowheadLengthMedium
    Selection.ShapeRange.Line.EndArrowheadWidth = msoArrowheadWidthMedium
    Selection.ShapeRange.Flip msoFlipHorizontal
    ActiveDocument.Shapes.AddLine(261#, 135#, 306#, 198#).Select
    Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadTriangle
    Selection.ShapeRange.Line.EndArrowheadLength = msoArrowheadLengthMedium
    Selection.ShapeRange.Line.EndArrowheadWidth = msoArrowheadWidthMedium
    ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 153#, _
        216#, 90#, 54#).Select
    Selection.ShapeRange.TextFrame.TextRange.Select
    Selection.Collapse
    Selection.TypeText Text:="xys"
    Selection.ShapeRange.Select
    ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 297#, _
        207#, 81#, 63#).Select
    Selection.ShapeRange.TextFrame.TextRange.Select
    Selection.Collapse
    Selection.TypeText Text:="lop"

hi
Hthis is my sap program.. where to use this coding concept what are the data s to be declared
*DATA declarations
*--Include for OLE-enabling definitions
INCLUDE ole2incl .
*--Global variables *--Variables to hold OLE object and entity handles
DATA:   word TYPE ole2_object , "OLE object handle
    documents TYPE ole2_object  , "Documents
  doc TYPE ole2_object  , "Documents
    actdoc TYPE ole2_object  , "Active document
    application TYPE ole2_object  , "Application D
    options TYPE ole2_object  , "Application options
    actwin TYPE ole2_object  , "Active window
    actpan TYPE ole2_object  , "Active pane
    view TYPE ole2_object  , "View
    selection TYPE ole2_object  , "Selection
    font TYPE ole2_object  , "Font
    parformat TYPE ole2_object  , "Paragraph format
    tables TYPE ole2_object  , "Tables
    range TYPE ole2_object  , "Range handle for various ranges
    table TYPE ole2_object  , "One table
    table_border TYPE ole2_object  , "Table border
    cell TYPE ole2_object  , "One cell of a table
    paragraph TYPE ole2_object  , "Paragraph
    shapes  TYPE ole2_object  ,
    logo TYPE ole2_object  ,
    textbox  TYPE ole2_object,
    find TYPE ole2_object,
picture(128) ,
  gv_pos(5) TYPE n . "Position information for table
START-OF-SELECTION .
  picture = 'D:\BMP\test.bmp'.
*-Creating OLE object handle variable
  CREATE OBJECT   word 'WORD.APPLICATION' .
  IF sy-subrc NE 0 .
    MESSAGE s000(su) WITH 'Error while creating OLE object!'.
    LEAVE PROGRAM .
  ENDIF .
*-Setting object's visibility property
  SET PROPERTY OF   word 'Visible' = '1' .
* Adding documents
  CALL METHOD OF word 'DOCUMENTS' = documents.
* Adding New page
  CALL METHOD OF documents 'Add' = doc.
* Retrieving thre Property of Word for Alignment Changes
  GET PROPERTY OF   word      'Selection' =   selection.
  GET PROPERTY OF   selection 'Font' =   font .
  GET PROPERTY OF   selection 'ParagraphFormat' =   parformat.
* Changes in Our Requirement
  SET PROPERTY OF   font 'Name' = 'Arial' .
  SET PROPERTY OF   font 'Size' = '20' .
  SET PROPERTY OF   font 'Bold' = '1' . "Not bold
  SET PROPERTY OF   font 'Italic' = '1' . "Italic
  SET PROPERTY OF   font 'Underline' = '1' . "Not underlined
* Paragraph Format 1 - Center 2 - Right  3 - Left
  SET PROPERTY OF parformat 'Alignment' = '1'.
* Text to be displayed
  CALL METHOD OF selection 'TypeText'
    EXPORTING
    #1 = 'Organisational Structure'.
*--Getting active document handle
  GET PROPERTY OF word 'activedocument' = actdoc .
*  To Save the document
  CALL METHOD OF doc 'SaveAs'
    EXPORTING
    #1 = 'D:\TEMP\WordFormatOLE.doc'.
**  To Quit the Document
CALL METHOD OF word 'Quit' .

Similar Messages

  • How to set to bold a single word in the text box?

    How can I set to bold a single word in the text box? When I try, it puts the whole text bold.

    you should do this by HTML way
    like this :
    sym.$("your text box Name").html("Hello i'm <strong>Bold</strong> one")
    Zaxist

  • To limit the words usage in text area

    Hi there,
    Can u help me. How can I limit the usage of words in the text area?
    Your help very needed.
    thanks

    here's a tutorial that introduces the idea of a document filter
    http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html#filter
    kind regards
    walken

  • How/can I change the color of the title or word in a text box?

    Also, can I change the background color too? If so, how? Thanks!

    Select the title / text and then click on the "i" (inspector). A colored pin wheel shows up after you click on the square box directly below the font settings inside the inspector window. Then simply drag the dot to the color you want. Like this:
    click here
    Message was edited by: SDMacuser

  • Multi-select and change only certain words in a text box to different font - possible?

    In Word I can select a number of words in a sentence or paragraph by holding the Shift key (PC, natch!) and then bold all of them at the same time, etc. Can't make this happen in inDesign - am I missing something simple?
    Need to take a list like the one below and bold only the dates, using the bold version of the font I'm using - thereby actually changing fonts.
    June 1  Something
    June 25  Something else
    July 24  Something else entirely
    Thanks for any help you can offer.
    Joan

    Hi,
    John is right.
    However, I advise you to take a look at HighlightGrep, [JS] written by Roland Dreger, with an amazing "Live Mode" option that allows you to see the result of a research (before launching it, of course) while you're building your query … simulating your "selection".
    … and, as john said, may be finish the deal with nested styles !

  • How do I add color to a text box border in Pages app?

    Can't find it anywhere. And don't have time to keep looking. Wondering if you can do this in Pages (in Word, you insert text box, then under Format you get in drop down menu "Borders and Shading" and then you can add color just to the border).
    Can you do this in Pages app? I've looked everywhere.
    Thanks! You'll save me a boatload of time.

    Pages ’09 v4.3
    Inspector > Graphic > Stroke
    Pages v5.2.2
    Format > Style > Border
    In either case, the color well will appear.

  • How can I make the Counter move from inside text box to inside Footer?

    I am tweaking a page. At this point, I cannot move the Counter and the Email Me icon from the bottom of the text box to inside the footer like someone here said he does.
    Why do the Counter and the Email Me icon resist being moved?
    I am in Graphics mode. I never had this problem before.
    — Lorna in Southern California

    Lorna,
    I'm not sure why you can't move it down into the
    footer — by inside the text box, do you mean the page
    "content" or "body" section, or did you somehow get
    the icons into a text box? I know that you can
    "force" a text box into the footer (or header) by
    selecting it, then dragging it while holding the
    command (Apple) key down at the same time.
    Hope this helps.
    Bob
    Bob,
    When I say Text box maybe I am not using the right word. I am referring to that entire space on the page which is dedicated to receiving documents or images. If you have a lot of pictures or words, then that text box/space has to be lengthened to accomodate.
    I am saying that the two icons -- Counter and Email Me -- are sitting (or were sitting. It's morning now and honestly, I can't recall from last night!) at the very bottom of the text box/space.
    I made a Footer (55 pixels) specially to accomodate the Counter and Email icons. The problem, as stated, was/is that those icons would not budge from where they were sitting.
    — Lorna in Southern California

  • Counting words in a text widget

    Hi,
    Is there a way I can count the number of words in a text box widget?  I realise that means counting the number of words in the attached variable - but can I do this?
    I have tried playing with Javascript (about which I know nothing)
    I put the script below into the script window for a button, but nothing seems to happen!
    Test=Q5WidgetAnswer.split(" ").length-1;
    document.write(Test);
    I want to check for three words in an answer and if there are only two, or four, warn that there are Three answers.
    Would be grateful for any help!

    After much heartache I solved the issue. 
    The code needed to be as follows:
    var objCP = document.Captivate;
    var Answer = objCP.cpEIGetValue('WidgetAnswer');
    var Words;
    if(Answer ==  ''){   /* tests for empty answer */
      Words=0;
    alert("Fred")
    else {
    Words = Answer.replace(/[^ ]/g,'').length+1;    /* counts the number of spaces in answer */
    Where objCP can be any name you want, and cpEISetValue and cpEIGetValue are special Captivate functions
    /* and */ enclose a comment

  • Dynamic Text box with linking to frames

    I have a problem. I've tried everything I can think of and what I have Googled, but nothing has helped. I have a scrolling dynamic text box and I need some words in that text box to link to frames, like buttons (Not a URL). This is the file and the frame I'm on is "conflictNorthernPlains"     https://dl.dropbox.com/u/72608572/civilWarEra7.zip
    Thanks

    use:
    var tf:TextField = new TextField();
    addChild(tf);
    tf.htmlText = "<a href='event:frame1'>link to  frame1</a><br/>";
    tf.htmlText += "<a href='event:frame2'>link to frame2</a><br/>";
    tf.addEventListener(TextEvent.LINK, tfF);
    function tfF(e:TextEvent):void{
    gotoAndStop(e.text);
    p.s.  please mark helpful/correct responses, if there are any.

  • Select all text boxes (help)

    I will try to explain this as best I can, bare with me.
    I'm using Acrobat X 10 and I'm trying to print a PDF file that are slides from one of my university classes. The problem I'm having is that some of the text is not printing or printing very lightly. I have solved this problem by going to the tools panel and then edit document text tool. From there I select a text box, select all text in said text box, select properties, click on the text tab and then changing the fill from white to black(following so far?). Now my issue is that there are many text boxes, to the point where only one word occupies a text box. So what I'm wondering is if there is a way to select all the text boxes so I can do this proccess for the whole file rather than selecting each text box and repeating the proccess, as this is very time consuming.
    Any help is appreciated.

    Why don't you see if your printer driver has an option for printing B&W (not grey or greyscale), that might do the trick.

  • Displaying a mix of L to R and R to L readable strings in a single text box

    Folks,
    Is it possible to get accurate display of fields when  English string values and hebrew characters are dragged into a single text box for viewing.
    Currently while doing this the display gets erratic as some of the english strings gets displayed in the middle of a hebrew word.
    the whole text box data needs to be read as R to L , with the exceptions of a few English string DB values.
    Is this achievable ?  Thanks for your help.
    -Jayakrishnan

    Thanks for your reply Jamie.
    I am not sure whether I made my requirement really clear.
    I have these formula which display words in multiple languages, say english , hebrew , korean etc. The data value for this formula will be supplied by the framework externally at run time depending on which language has been selected.
    Now for this scenario I got to display 50 + objects in a concatenated fashion containing the combination of above said formula ( Labels ) and their DB values.
    For hebrew language the text growth should be R to L even if it would containg DB fields which may be integers or strings.
    The logic you have mentioned in the txt file, I have not understood why we need to reverse the string as I am assuming the characters would be laid out correctly.
    The missing part is when the string grows to the next line the printing should start from the Right and not from the Left.
    Hope this would be a little more clear.  Appreciate your time.
    -Jayakrishnan

  • I can't see text that need to be type on text boxes to finalize a post or cancel/change accounts in certain webpages

    Every time I need to post ask something in a certain web page y have a last step asking me to type two words into a text box to finalize my post,but I can't even see the words, not even refreshing the page, same thing when I want to cancel an account in another web page they ask me to type the words in a security box, but I don't see any words, is there something into my internet configuration I need to change? please help!

    See:
    * http://kb.mozillazine.org/Images_or_animations_do_not_load
    * You can see the permissions for the domain in the current tab in Tools > Page Info > Permissions
    * You can see image settings in Tools > Options > Content: Load Images
    * You can see all exceptions in Tools > Options > Content: Load Images > Exceptions
    * You can check the Tools > Page Info > Media tab for blocked images (scroll through all the images)
    There are also extensions (Tools > Add-ons > Extensions) and security software (firewall) that can block images.

  • SAP OLE to MS Word

    I have used this coding for sap OLE to Ms word... but if i run this program... MS Word just opens but i am not able to view any of the statements... that is new documents are not openings and the statements  are not reflecting...
    Any one give me a tips what to change in this following code...
    Include for OLE-enabling definitions
    INCLUDE ole2incl .
    *Global variables *Variables to hold OLE object and entity handles
    DATA:     gs_word       TYPE   ole2_object ,
    *"OLE object handle
            gs_documents    TYPE   ole2_object ,
    *"Documents
            gs_actdoc       TYPE   ole2_object  , "Active document
            gs_application  TYPE   ole2_object  , "Application
            gs_options      TYPE   ole2_object  , "Application options
            gs_actwin       TYPE   ole2_object  , "Active window
            gs_actpan       TYPE   ole2_object  , "Active pane
            gs_view         TYPE   ole2_object  , "View
            gs_selection    TYPE   ole2_object  , "Selection
            gs_font         TYPE   ole2_object  , "Font
            gs_parformat    TYPE   ole2_object  , "Paragraph format
            gs_tables       TYPE   ole2_object  , "Tables
            gs_range        TYPE   ole2_object  , "Range handle for various ranges
            gs_table        TYPE   ole2_object  , "One table
            gs_table_border TYPE   ole2_object  , "Table border
            gs_cell         TYPE   ole2_object  , "One cell of a table
            gs_paragraph    TYPE   ole2_object  , "Paragraph
            gv_pos(5)       TYPE   n . "Position information for table
    START-OF-SELECTION .
    *--Creating OLE object handle variable
      CREATE OBJECT gs_word 'WORD.APPLICATION' .
      IF sy-subrc NE 0 .
        MESSAGE s000(su) WITH 'Error while creating OLE object!'.
        LEAVE PROGRAM .
      ENDIF .
    *--Setting object's visibility property
      SET PROPERTY OF gs_word 'Visible' = '1' .
    *--Opening a new document
      GET PROPERTY OF gs_word 'Documents' = gs_documents .
    **--Setting the measurement unit
      GET PROPERTY OF gs_application 'Options' = gs_options .
    SET PROPERTY OF gs_options 'MeasurementUnit' = '1' . "CM
    *Getting handle for the selection which is here the character at the *cursor position
      GET PROPERTY OF gs_application 'Selection' = gs_selection .
      GET PROPERTY OF gs_selection 'Font' = gs_font .
      GET PROPERTY OF gs_selection 'ParagraphFormat' = gs_parformat .
    *--Setting font attributes
      SET PROPERTY OF gs_font 'Name' = 'Arial' .
      SET PROPERTY OF gs_font 'Size' = '10' .
      SET PROPERTY OF gs_font 'Bold' = '0' . "Not bold
      SET PROPERTY OF gs_font 'Italic' = '1' . "Italic
      SET PROPERTY OF gs_font 'Underline' = '0' . "Not underlined
    *--Setting paragraph format attribute
      SET PROPERTY OF gs_parformat 'Alignment' = '2' . "Right-justified
      CALL METHOD OF gs_selection 'TypeText'
        EXPORTING #1 = 'This is an OLE example!'.
    *--Setting the view to the main document again
      SET PROPERTY OF gs_view 'SeekView' = '0' . "Main document view
    *--Reseting font attributes for the title
      SET PROPERTY OF gs_font 'Name' = 'Times New Roman' .
      SET PROPERTY OF gs_font 'Size' = '16' .
      SET PROPERTY OF gs_font 'Bold' = '1' . "Bold
      SET PROPERTY OF gs_font 'Italic' = '0' . "Not Italic
      SET PROPERTY OF gs_font 'Underline' = '0' . "Not underlined
    *--Setting paragraph format attribute
      SET PROPERTY OF gs_parformat 'Alignment' = '1' . "Centered
      CALL METHOD OF gs_selection 'TypeText'
        EXPORTING #1 = text-001.
    *--Advancing cursor to the new line
      CALL METHOD OF gs_selection 'TypeParagraph' .
    *--Reseting font attributes for ordinary text
      SET PROPERTY OF gs_font 'Name' = 'Times New Roman' .
      SET PROPERTY OF gs_font 'Size' = '12' .
      SET PROPERTY OF gs_font 'Bold' = '0' . "Not bold
      SET PROPERTY OF gs_font 'Italic' = '0' . "Not Italic
      SET PROPERTY OF gs_font 'Underline' = '0' . "Not underlined
    *--Setting paragraph format attribute
      SET PROPERTY OF gs_parformat 'Alignment' = '3' . "Justified
      CALL METHOD OF gs_selection 'TypeText'
        EXPORTING #1 = text-001.
    *--skip some lines
      DO 4 TIMES .
        CALL METHOD OF gs_selection 'TypeParagraph' .
      ENDDO .
    *--Getting entity handles for the entities on the way
      GET PROPERTY OF gs_actdoc 'Tables' = gs_tables .
      GET PROPERTY OF gs_selection 'Range' = gs_range .
    *--Adding a table with 3 rows and 2 columns
      CALL METHOD OF gs_tables 'Add' = gs_table
      EXPORTING #1 = gs_range " Handle for range entity
                #2 = '3' "Number of rows
                #3 = '2'. "Number of columns
    *--Setting border attribute for the table
      GET PROPERTY OF gs_table 'Borders' = gs_table_border .
      SET PROPERTY OF gs_table_border 'Enable' = '1' . "With border
    *Filling the table with dummy data *Reseting font attributes for table content
      SET PROPERTY OF gs_font 'Name' = 'Garamond' .
      SET PROPERTY OF gs_font 'Size' = '11' .
      SET PROPERTY OF gs_font 'Bold' = '0' . "Not bold
      SET PROPERTY OF gs_font 'Italic' = '0' . "Not Italic
      SET PROPERTY OF gs_font 'Underline' = '0' . "Not underlined
    *--Getting cell coordinates
      CALL METHOD OF gs_table 'Cell' = gs_cell
      EXPORTING #1 = '1' "first row
                #2 = '1'. "first column
    *--Getting the range handle to write the text
      GET PROPERTY OF gs_cell 'Range' = gs_range .
    *--Filling the cell
      SET PROPERTY OF gs_range 'Text' = 'OLE' .
    *--Getting cell coordinates
      CALL METHOD OF gs_table 'Cell' = gs_cell
      EXPORTING
            #1 = '3' "third row
            #2 = '2'. "second column
    *--Reseting font attributes for ordinary text
      SET PROPERTY OF gs_font 'Name' = 'Times New Roman' .
      SET PROPERTY OF gs_font 'Size' = '12' .
      SET PROPERTY OF gs_font 'Bold' = '0' . "Not bold
      SET PROPERTY OF gs_font 'Italic' = '0' . "Not Italic
      SET PROPERTY OF gs_font 'Underline' = '0' . "Not underlined
    *--Setting paragraph format attribute
      SET PROPERTY OF gs_parformat 'Alignment' = '3' . "Justified *--Indent the paragraph once
      GET PROPERTY OF gs_selection 'Paragraphs' = gs_paragraph .
      CALL METHOD OF gs_paragraph 'Indent' .
      CALL METHOD OF gs_selection 'TypeText'
        EXPORTING
        #1 = text-001.
      FREE OBJECT gs_word .
    Thanks @ Regards,
    Hema

    HI Hema,
    To open new document add this line.
    *--Opening a new document
    get property of gs_word 'Documents' = gs_documents.
    call method of gs_documents 'ADD' ."= gs_document.
    Regards,
    Sravanthi

  • When converting word doc to pdf, my images with text only show the background color of the text box.

    I have a word doc that I am trying to conver to pdf.  I have jpegs with text boxes on top of them on one page.  It looks great on the screen but after I convert to pdf, the text boxes only have half the text, the first half of the text box is just white - the background color.  If I take the background color out of the text box, the text converts over fine but I need the background color.
    I have tried many things here on the print settings, standard, high quality print, unchecking the compression on the images.  Any help?

    Thank you for your posting. These forums are specific to the
    Acrobat.com website and it's set of hosted services, and do not
    cover the Acrobat family of desktop products. Please visit the
    following forums for any questions related to the Acrobat family of
    desktop products:
    http://www.adobeforums.com/cgi-bin/webx/.3bbeda8b/

  • How to center Text Box on Web Page? -- Web dev with Word 2013

    I'm trying to assist a user who wants to use Word 2013 for simple web page development.
    There are many tools but they want to use Word 2013.
    Actually have it working by saving the Word 2013 files as web pages... like index.htm, about.htm, etc.
    The problem is when we use the "Insert" tab in Word to create a "Text Box" or a "Shape" ...
    And align it centered on the page... it looks fine in Word but when we open it with a web browser the "Text Box" or "shape" are no longeer centered.
    We thought we had it fixed by making the "Text Box" Layout Options "In Line with Text" but again... looks fine in Word but not in a web browser.
    The question: How can we get a "Text Box" in Word 2013 to appear centered on a web page?
    thanks for any help.

    Hi:
    For webpage design, I would suggest customized form under develop tab on the Ribbon over insert object directly. I tested from my side, using customized form will lock the object position on the
    page.

Maybe you are looking for

  • XML file to Oracle Table

    Hello friends, Can you please help me with the following requirements? I have a xml structure like this <?xml version="1.0"?> <data> <var name="document"> <string>Sales Order</String> </var> <var name="results"> <recordset rowcount="2"> <field name="

  • How to use PL/SQL procs with portlet enabled CA's?

    I have written some PL/SQL procedures in a package. Now I would like to use this in a FOLDER-portlet (a new CA created for this purpose). But when I select the 'Open Item In Folder' (which should show the PL/SQL procedure results in the portlet I hop

  • How to Create System messages in BW

    I want to create a System message in BW. Please let me know. Thanks Prasanna

  • Uninstall previous versions of Java before applying new version?

    Hi, I would like to push out java version 8.0.3.1 to some clients but I would like to uninstall any previous versions before doing so. Is this possible to do so? Maybe using supersendence? I am not sure what the best way to do this if anyone has any

  • How do you do post item validations or calculations?

    In Oracle Forms, you can use Post Item triggers or When Validate Item triggers to validate data or do calculations as you move out of a form field. How can I do the same in Apex?