Adding Graphic Styles using VBA

Hi all
How would I go about applying graphic styles to a path using VBA? I would imagine the following line is wrong because it doesn't work.Any help would be appreciated.
idoc.GraphicStyles("02-S").ApplyTo (isquare2)

You're right, it is no fun to have someone give you all the answers. Trial and error is how I learn the most, well it least to make it stick.  Believe me, I go online and try out different things before posting anything on here. Along the way, I might not find the answer I'm looking for, but I always find something out, and most of the time, it's something I needed a while back.
Yep, I've seen that error quite a few times on numerous projects, it means that the object isn't affected by the methods or properties I'm trying to affect it with.
However, I was able to make it work by removing the () from the object variable isquare2.
idoc.GraphicStyles("02-S").ApplyTo isquare2
Thanks for the challenge Carlos!

Similar Messages

  • Problem with Batch Processing an Action using a Graphic Style Library

    Hi,
    I have ~100 files in which I need to change the fill and stroke of all the linework. I created Graphic Styles for all my new features. I then created an Action that sets a fill and stroke color, Select Same Fill and Stroke, then applies the new Graphic Style. This repeats for about 20 variations (ie; select all Fill=X, Stroke=Y, then apply Graphic Style A. Select all Fill=X2, Stroke=Y2 then apply Graphic Style B). It runs fine in my test file. The problem occurs when I try to run it in batch mode. I have my new Graphic Style Library set to Persistent, so that it is open for every file. But the action does not apply the new Graphic Styles. It's like it doesn't see/read the Graphic Style Library. I don't get any errors, the action completes. It just doesn't apply anything.
    Does anybody know what I am doing wrong? Are you not able to use an action to apply a graphic style from an added Library?  Do I need to add the graphic styles to the Graphic Styles Panel and have the action reference the Panel, not the Library?
    Any help or insight is appreciated.
    M

    Try this:
    Copy an item that has the Graphic Style to the clipboard before starting the action. Then put a paste step followed by a delete step at the start of the action.
    Hope that helps.
    Mike D.

  • Graphic styles that use current fill color instead of stomping them?

    Sorry if this is a really stupid, newbie question; I am a stupid newbie.
    If I make a graphic style/appearance, it stores the colors of the fill and stroke and will then stamp that down on whatever else I apply it to (obviously). e.g. if I make a graphic style of a pale yellow fill and a bright orange dropshadow screen to make a glowing neon kind of look, and then drop that style onto a bright blue star, it will make the star pale yellow.
    Is there a way to do a graphic style that _modifies_ the existing appearance instead of stomping it - e.g. dropping that graphic style on my blue star would make a pale blue fill with a bright green dropshadow screen.
    e.g. A graphic style that said "make the new fill 110% value, 85% saturation, same hue as the existing fill color, add a 25 pt dropshadow that has the color of 90% value, 110% saturation, -3 hue of the existing fill color." And then that style dropped on a yellow star and a blue star would result in a glowing neon yellow star and a glowing neon blue star.
    The reason I ask: I have a bunch of geometric shapes of various shades of red, orange, yellow and brown, and would like to see what they would all look like with dropshadows of dark, very desaturated complementary colors (the orange shape gets a dark blue/gray dropshadow, the yellow shape gets a dark purple/gray dropshadow, etc.). Do I have to go in and modify each appearance by hand, or is there some way I can automate that?
    Thanks, and apologies if this is a really obvious question.
    Ken

    You won't get as much control as you describe (specific HSV values), but try putting a negative value in the Drop Shadow dialog's Darkness field.
    To create a Graphic Style that can apply an Effect without disturbing the existing fill/stroke of the object(s), first group the object(s), then apply the Effect (Drop Shadow, etc.) to the Group, and then drag the Group to the Graphic Styles palette.

  • [b]Tutorial:[/b] Simplify Developing OLE Automation Code Using VBA

    INTRODUCTION
    Automating Office applications from Oracle Forms can be a tedious, frustrating, and time-consuming process. Because the OLE2 and CLIENT_OLE2 built-ins do not validate the automation commands that they relay, code that compiles without errors often dies at runtime with a not-so-helpful error code. This tutorial will demonstrate how to simplify the development of automation code using a tool that ships with all Microsoft Office editions -- the Visual Basic for Applications (VBA) IDE.
    The VBA IDE, a core Office component, is a full-fledged development environment featuring code completion, basic syntax highlighting, context-driven help and a runtime debugger. Its Object Browser provides a convenient means of browsing the Word object model, as well as searching by keyword.
    For those who may not interested in following this tutorial in detail, I would like to stress the usefulness of the Object Browser as a tool for inspecting the functions supported by OLE server applications and, perhaps more importantly, valid values for function arguments. Whether/not anyone buys the assertion that starting with VBA prototypes is far more productive than pounding out OLE2 code from the very start, they will find the Object Browser invaluable as a reference -- I rely on it exclusively for this sort of documentation.
    A BRIEF INTRODUCTION TO THE VBA IDE & THE OBJECT BROWSER UTILITY
    Try this:
    1. Open Word
    2. Launch the VBA IDE by pressing <Alt><F11>
    3. Open the Object Browser by pressing <F2>
    The Object Browser allows you to visually navigate Word's class hierarchy. Its user interface is a bit crowded, so controls are unlabeled. Hovering the mouse cursor above a control will display a tooltip explaining that control's purpose. The browser's scope can be narrowed by using the Project/Library combo. Typing a keyword or substring in the Search Text combo and clicking on the Search button will cause all classes/members whose name contains the specified search text to be listed in the Search Results pane. Selecting an item from this list will update the two panes below it, showing the selected class, and its members. Beneath the Classes and Members panes is an untitled pane, gray in color, which displays details for the selected class/member, including hyperlinks to relevant information such as arguments, their types and allowable values. If Visual Basic Help is installed, pressing <F1> will display help on a selected class/member. (This feature can be installed from your Office install CD, if necessary.)
    NOTE: While it is possible to cut-and-paste the code examples that follow, I highly recommend that they be typed in by hand. Doing so will provide a better understanding of how the IDE's code completion behaves. Use code completion most efficiently by not using the mouse or <Enter> key when selecting from completion lists. Instead, just type enough letters to select the desired list element, then continue along as if you had typed the entire element, typing the next operator in your statement. It really is slick!
    HELLO WORLD - VBA-STYLE
    1. Open Word
    2. Launch the VBA IDE by pressing <Alt><F11>
    3. Select Module from the Insert menu.
    4. In the blank area that appears, enter the following code:
      Public Sub HelloWorld()
          Documents.Add
          Selection.TypeText ("Hello, world!")
      End Sub5. Press <F5> to run the code.
    If you switch back to Word by pressing <Alt><F11>, there should appear a newly-created document containing the text Hello, world!.
    A MORE AMBITIOUS EXAMPLE
    In this example, we will launch Word, type some text, and alter its formatting. For the purposes of this tutorial, consider it the process we wish to automate from within Forms.
    1. If Word is running, close it.
    2. Open any Office application except Word, such as Excel, Outlook or PowerPoint
    3. Launch the VBA IDE by pressing <Alt><F11>.
    4. Select References from the Tools menu -- a dialog should pop up.
    5. From within this dialog, locate and select Microsoft Word <version> Object Library, then click OK.
    6. Select Module from the Insert menu.
    7. In the blank area that appears, enter the following code:
    Public Sub LaunchWord()
        Dim app As Word.Application
        Set app = CreateObject("Word.Application")
        app.Visible = True                          '!!! IMPORTANT !!!
        app.Documents.Add
        With app.Selection
            .TypeText "This is paragraph 1."
            .TypeParagraph
            .TypeText "This is paragraph 2."
            .TypeParagraph
            .TypeText "This is paragraph 3."
        End With
        With ActiveDocument
            .Paragraphs(1).Range.Words(3).Bold = True
            .Paragraphs(2).Range.Words(3).Italic = True
            .Paragraphs(3).Range.Words(3).Underline = True
        End With
    End Sub8. Press <F5> to run the code.
    A new Word session should have been launched. Switch to it, to view the results of our handiwork!
    TAILORING VBA CODE INTENDED FOR OLE2 CONVERSION
    Now, things get a bit uglier. The code listed above gives a good idea of how concise VBA code can be, but With blocks and chained object references do not translate readily into OLE2 code. Here's the same process, rewritten in a more OLE2-friendly style. Note the numerous intermediate object references that have been declared.
    Public Sub LaunchWord()
        Dim app As Word.Application
        Dim doc As Word.Document
        Dim docs As Word.Documents
        Dim pars As Word.Paragraphs
        Dim par As Word.Paragraph
        Dim wrds As Word.Words
        Dim sel As Word.Selection
        Dim rng As Word.Range
        Set app = CreateObject("Word.Application")
        app.Visible = True                          '!!! IMPORTANT !!!
        Set doc = app.Documents.Add
        Set sel = app.Selection
        sel.TypeText "This is paragraph 1."
        sel.TypeParagraph
        sel.TypeText "This is paragraph 2."
        sel.TypeParagraph
        sel.TypeText "This is paragraph 3."
        Set pars = doc.Paragraphs
        'select third word of first paragraph and make it bold
        Set par = pars.Item(1)
        Set rng = par.Range
        Set wrds = rng.Words
        Set rng = wrds.Item(3)
        rng.Bold = True
        'select third word of second paragraph and italicize it
        Set par = pars.Item(2)
        Set rng = par.Range
        Set wrds = rng.Words
        Set rng = wrds.Item(3)
        rng.Italic = True
        'select third word of second paragraph and underline it
        Set par = pars.Item(3)
        Set rng = par.Range
        Set wrds = rng.Words
        Set rng = wrds.Item(3)
        rng.Underline = True
    End Sub
    TRANSFORMATION: CONVERTING VBA CODE INTO PL/SQL
    Here is the PL/SQL counterpart to our previous VBA routine. Compare printouts of the two and note their similarities. Notice the need for argument lists -- this causes the code to fluff up quite a bit, and really interferes with readability.
    PROCEDURE LAUNCH_WORD IS
      v_app OLE2.OBJ_TYPE;     -- Application
      v_doc OLE2.OBJ_TYPE;     -- Document
      v_docs OLE2.OBJ_TYPE;    -- Documents collection
      v_pars OLE2.OBJ_TYPE;    -- Paragraphs collection
      v_par OLE2.OBJ_TYPE;     -- Paragraph
      v_wrds OLE2.OBJ_TYPE;    -- Words collection
      v_sel OLE2.OBJ_TYPE;     -- Selection
      v_rng OLE2.OBJ_TYPE;     -- Range
      v_args OLE2.LIST_TYPE;   -- OLE2 argument list
    BEGIN
      /* launch Word and MAKE IT VISIBLE!!! */ 
        v_app := OLE2.CREATE_OBJ('Word.Application');
        OLE2.SET_PROPERTY(v_app, 'Visible', TRUE);
      /* initialize key object references */ 
        v_docs := OLE2.GET_OBJ_PROPERTY(v_app, 'Documents');
        v_doc := OLE2.INVOKE_OBJ(v_docs, 'Add');
        v_sel := OLE2.GET_OBJ_PROPERTY(v_app, 'Selection');
      /* type first paragraph */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 'This is paragraph 1.');
        OLE2.INVOKE(v_sel, 'TypeText', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        OLE2.INVOKE(v_sel, 'TypeParagraph');
      /* type second paragraph */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 'This is paragraph 2.');
        OLE2.INVOKE(v_sel, 'TypeText', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        OLE2.INVOKE(v_sel, 'TypeParagraph');
      /* type third paragraph */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 'This is paragraph 3.');
        OLE2.INVOKE(v_sel, 'TypeText', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
      /* set reference to Paragraphs collection */
        v_pars := OLE2.GET_OBJ_PROPERTY(v_doc, 'Paragraphs');
      /* select third word of first paragraph and make it bold */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 1);
        v_par := OLE2.INVOKE_OBJ(v_pars, 'Item', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        v_rng := OLE2.GET_OBJ_PROPERTY(v_par, 'Range');
        v_wrds := OLE2.GET_OBJ_PROPERTY(v_rng, 'Words');
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 3);
        v_rng := OLE2.INVOKE_OBJ(v_wrds, 'Item', v_args);
        OLE2.SET_PROPERTY(v_rng, 'Bold', TRUE);
      /* select third word of second paragraph and italicize it */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 2);
        v_par := OLE2.INVOKE_OBJ(v_pars, 'Item', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        v_rng := OLE2.GET_OBJ_PROPERTY(v_par, 'Range');
        v_wrds := OLE2.GET_OBJ_PROPERTY(v_rng, 'Words');
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 3);
        v_rng := OLE2.INVOKE_OBJ(v_wrds, 'Item', v_args);
        OLE2.SET_PROPERTY(v_rng, 'Italic', TRUE);
      /* select third word of second paragraph and underline it */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 3);
        v_par := OLE2.INVOKE_OBJ(v_pars, 'Item', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        v_rng := OLE2.GET_OBJ_PROPERTY(v_par, 'Range');
        v_wrds := OLE2.GET_OBJ_PROPERTY(v_rng, 'Words');
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 3);
        v_rng := OLE2.INVOKE_OBJ(v_wrds, 'Item', v_args);
        OLE2.SET_PROPERTY(v_rng, 'Underline', TRUE);
    END;
    REFACTORING FOR REUSABILITY AND READABILITY
    While the previous procedure runs without errors, it suffers from poor readability which, in turn, makes it difficult to maintain. Here, we address those issues by moving repetetive low-level operations into separate procedures.
      PROCEDURE LAUNCH_WORD IS
        v_app OLE2.OBJ_TYPE;    -- Application
        v_doc OLE2.OBJ_TYPE;    -- Document
        v_docs OLE2.OBJ_TYPE;   -- Documents collection
        v_sel OLE2.OBJ_TYPE;    -- Selection
        v_args OLE2.LIST_TYPE;  -- OLE2 argument list
      BEGIN
        /* launch Word and MAKE IT VISIBLE!!! */ 
          v_app := OLE2.CREATE_OBJ('Word.Application');
          OLE2.SET_PROPERTY(v_app, 'Visible', TRUE);
        /* create a new Word document */ 
          v_docs := OLE2.GET_OBJ_PROPERTY(v_app, 'Documents');
          v_doc := OLE2.INVOKE_OBJ(v_docs, 'Add');
          v_sel := OLE2.GET_OBJ_PROPERTY(v_app, 'Selection');
        /* add a few paragraphs */
          PRINT_PARAGRAPH(v_sel, 'This is paragraph 1.');
          PRINT_PARAGRAPH(v_sel, 'This is paragraph 2.');
          PRINT_PARAGRAPH(v_sel, 'This is paragraph 3.');
        /* apply formatting */
          APPLY_FORMATTING(v_doc, 1, 3, 'Bold', TRUE);
          APPLY_FORMATTING(v_doc, 2, 3, 'Italic', TRUE);
          APPLY_FORMATTING(v_doc, 3, 3, 'Underline', TRUE);
      END;
      PROCEDURE APPLY_FORMATTING(
        v_doc OLE2.OBJ_TYPE,
        v_paragraph_num NUMBER,
        v_word_num NUMBER,
        v_attribute VARCHAR2,
        v_value BOOLEAN) IS
        v_pars OLE2.OBJ_TYPE;   -- Paragraphs collection
        v_par OLE2.OBJ_TYPE;    -- Paragraph
        v_wrds OLE2.OBJ_TYPE;   -- Words collection
        v_rng OLE2.OBJ_TYPE;    -- Range
        v_args OLE2.LIST_TYPE;  -- OLE2 argument list
      BEGIN
        /* set reference to Paragraphs collection */
          v_pars := OLE2.GET_OBJ_PROPERTY(v_doc, 'Paragraphs');
        /* get specified paragraph */   
          v_args := OLE2.CREATE_ARGLIST;
          OLE2.ADD_ARG(v_args, v_paragraph_num);
          v_par := OLE2.INVOKE_OBJ(v_pars, 'Item', v_args);
          OLE2.DESTROY_ARGLIST(v_args);
        /* get words for specified paragraph */
          v_rng := OLE2.GET_OBJ_PROPERTY(v_par, 'Range');
          v_wrds := OLE2.GET_OBJ_PROPERTY(v_rng, 'Words');
        /* apply formatting to word found at specified index */
          v_args := OLE2.CREATE_ARGLIST;
          OLE2.ADD_ARG(v_args, v_word_num);
          v_rng := OLE2.INVOKE_OBJ(v_wrds, 'Item', v_args);
          OLE2.SET_PROPERTY(v_rng, v_attribute, v_value);
      END;
      PROCEDURE PRINT_PARAGRAPH(v_sel OLE2.OBJ_TYPE, v_text VARCHAR2) IS
        v_args OLE2.LIST_TYPE;
      BEGIN
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, v_text);
        OLE2.INVOKE(v_sel, 'TypeText', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        OLE2.INVOKE(v_sel, 'TypeParagraph');
      END;
    CONCLUSION
    It is my hope that this tutorial, despite it's introductory nature, has demonstrated the value of the VBA IDE, the ease with which automation processes can be prototyped using VBA, the noticeable similarity between VBA automation routines and their Forms PL/SQL counterparts, and the advantages of testing automation processes within the VBA IDE. Please feel free to follow up with any specific questions or concerns you may have.
    Thanks,
    Eric Adamson
    Lansing, Michigan
    FINAL NOTE: These examples use the OLE2 built-in, and will operate correctly when called from forms running in the Form Builder OC4J. Deploying them to an Oracle Application Server will launch Word on the server itself (if available), which is usually not the developer's intent! Automating Word client-side via web forms requires adding WebUtil support. Adapting the code for WebUtil is trivial -- just replace all instances of OLE2 with CLIENT_OLE2. Adapting forms for WebUtil and configuring OLE support into your Oracle Application Server, however, are beyond the scope of this tutorial.
    REVISION HISTORY
    This promises to be something of a 'living document'. I've snuck changes through without comment in the past, but in the future, I'll try to document significant changes here.
    2006-08-21
      * Prefaced boring subject line with text: 'Tutorial:' to clarify purpose
      * Added emphasis on value of Object Browser as a reference

    Thanks James, for your kind words. I do hope this information will help folks out. I honestly believe that tinkering around in the VBA IDE will prove highly gratifying for automation developers. It can be assured that learning to make Word jump through hoops is much more straight-forward in this environment. I'm not one for mottos, but if I were pressed for a cheesy motto, I would say: First, make it work. Then, make it work in Oracle!
    Once the idea has sunk in, that Visual Basic routines for automating Word are exact analogs to their OLE2 counterparts, we can remove keywords like Oracle and PL/SQL from our Google searches on Word automation which, at least in this context, are the proverbial kiss of death. Suddenly we find ourselves liberated by the possibility of steal-, ahem... borrowing ideas from the Visual Basic* community!
    As for links, my link of choice is invariably http://groups.google.com -- if you don't already use it at least ten times a day, you must try it. This is the venerable USENET archive, including the holdings of now-extinct DejaNews. Another possible site of interest is http://word.mvps.org/FAQs/MacrosVBA, which may serve as a good starting point for those who wish to learn how to do fancy tricks with Word using VBA.
    If these links don't prove immediately helpful, please feel free to give specifics on the sort of operations you are interested in automating, and I'll see if I can post an example that addresses it.
    Regards,
    Eric Adamson
    Lansing, Michigan
    PS: I do hope, as people read my posts, with every other acronym being VBA, that they are not mistakenly hearing a call to learn Visual Basic. I say this, not because I believe learning VB would be a Bad Thing, but because I assume that few of us feel we have the time to learn a new programming language. Despite having come to the Oracle camp already knowing VB/VBA, and having acquired a fair bit of experience with automating Office applications as an Access developer, I remain confident that what I am suggesting people attempt does not rise to the level of learning a language. What I am suggesting is that they learn enough of the language to get by.
    *VB vs. VBA
    Just a quick word on this, as readers may wonder why I seem to use these terms interchangeably. Visual Basic (VB) can refer to either a development platform or a programming language. Visual Basic for Applications (VBA) is a language -- more precisely, it is a subset of the Visual Basic language. One purchases VB, usually quite intentionally. VBA is included with Microsoft Office, as is VBA's development environment, the VBA IDE. The key distinction between VB and VBA is that VBA cannot be used to create self-contained executables. Rather, VBA relies on VBA-enabled applications, such as Microsoft Office applications, to serve as a container for VBA code, and to provide a runtime environment for that code. For the purposes of discussing OLE Automation, VB and VBA are quite interchangeable.

  • Creating bookmark using VBA

    Hi all,
    Im creating a pdf file with a number of bookmarks in it from Access using VBA. I want each bookmark to refer to a page in the document. Just wanted to confirm that I have understood this correcly. With current functionality I must use javascript to do this i.e this.pageNum=2 when I create the bookmark(createChild under JSObject). There is no possiblity to create it using the "standard" go to page functionality? I want to avoid javascript as much as possible since this functionality can be disabled. Any ideas would be greatly appreciated.
    Best Regards,
    Ingman

    I believe so. Or of course someone may already have commercially developed one and is selling it.
    Unless you can do something like get from Access to Word, automate adding Word styles, then use PDFMaker to make a PDF with bookmarks from styles.

  • Graphic Style that adds stroke without changing fill?

    I'd like to assign a graphic style that adds to the existing style. For example, I need to add the same stroke to various objects that  have different fills. Can I do that with a Graphic Style? I know I can group the object and add the style to the group, but this complicates the structure of the file. I would rather the stroke was just added to the object itself. I looked at "additive styles", but don't think they are what I'm looking for.
    Thanks,

    Thanks, Jean-Claude. You just made my job much easier. I used to think I knew Illustrator, until I met some of the people on this forum.

  • Illustrator Shape / Graphics Styles issue (bug?)

    When using the 'Split into Grid' command the resulting rectangles are defined as paths not shapes so that the live corners feature is not visible in the toolbar/transform palette.
    Since starting to write this I've stumbled upon the fact that while holding the Ctrl key with the object selected the live corners become visible and editable directly either via dragging the mouse or when double-clicking the mouse on the radius point where as options window appears to allow exact settings - this is great. It would be better if the toolbar/transform palette also reflected these settings to see at a glance which values have been used or even better, the resultant output of the 'Split into Grid' was defined  as a rectangle in the first place.
    Also, historically (CS5) I would save the rounded corner effect as a graphic style, I've noted that shapes with live corners set, do not copy those settings into the captured graphic style.
    Cheers!
    Rob

    Learning on the fly here, I just noticed the Object > Shape menu where you can convert a shape to rectangle when then enables the live corners to be updated. Perhaps a check box could be added to the 'Split into Grid' to enable this to be done automatically?
    The graphics styles issue still stands.

  • Create Attachment within Graphical Mapping using UDF

    Hi!
    We want to create an attachment witihn a graphical mapping using an UDF function.
    I use that function:
    public String addAttachment(String filename, String mimeType, String content, Container container) throws StreamTransformationException{
         BASE64Decoder decoder=new BASE64Decoder();
         try {
              GlobalContainer globalContainer = container.getGlobalContainer();
              OutputAttachments outputAttachments = globalContainer.getOutputAttachments();
              Attachment attachments = outputAttachments.create(filename, mimeType,decoder.decodeBuffer(content));
              outputAttachments.setAttachment(attachments);
              return "Adde1: "+filename;
         } catch (Exception e) {
              return e.toString();
    (SDN helped me much in creating that
    This function has no compiling errors, anything workes fine:
    It takes 3 input-parameters, see also: http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mapping/api/OutputAttachments.html
    filename (ok, more or less contentID)
    mimeType (more or less contentType)
    content: Base64-encoded String which should be set as content
    In my sample I use the following constants for that function:
    filename = "fn1.txt"
    mimeType="application/xml"
    content = "UG9seWZvbiB6d2l0c2NoZXJuZCBhw59lbiBNw6R4Y2hlbnMgVsO2Z2VsIFLDvGJlbiwgSm9naHVydCB1bmQgUXVhcms=" --> cames directly from http://de.wikipedia.org/wiki/Base64
    When using the message, I got this error within SXMB_MONI:
    <SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: Could not queue receive for
    message 0022642d-b106-02df-8e8c-f41c243bd112(INBOUND). Reason: java.lang.NullPointerException: while trying to
    invoke the method com.sap.aii.af.sdk.xi.lang.Binary.getBytes() of an object returned from
    com.sap.aii.af.sdk.xi.mo.xmb.XMBPayload.getContent()</SAP:AdditionalText>
    This looks pretty much the same as Add Attachment from ABAP Mapping but this tread is also not answered.
    Adding attachment from PI level looks also in that direction, again, no answer.
    So, I was wondering if someone has solved such problem?

    Hi Divyesh!
    We did it that way:
    1. Choosing the XML-Mailstructure as Destination as described in Configuring the Receiver Mail Adapter - Advanced Adapter Engine - SAP Library -  Example (XI payload with mail package)
    2. now we have created a UDF for creating the "content"
    public void getContent(String[] text, String[] attFname, String[] attType, String[] attContent, ResultList result, Container container) throws StreamTransformationException{
    // vergleich ob alle att-Arrays selbe anzahl haben
    if (attFname.length!=attType.length || attFname.length!=attContent.length) {
        result.addValue(Integer.parseInt("Fehler: alle Attachment-Eingänge müssen die selbe Anzahl an Elementen haben!"));
        String CRLF = "\r\n";
        String output="This is a multi-part message in MIME format."+CRLF+CRLF+
        "--"+getBoundary(container)+CRLF+
        "Content-Type: text/plain; charset=UTF-8"+CRLF+
        "Content-Disposition: inline" + CRLF + CRLF +
        text[0]+CRLF;
    for (int i=0;i<attFname.length;i++) {
        output+="--"+getBoundary(container)+CRLF+
        "Content-Type: "+attType[i]+"; name="+((char)34)+attFname[i]+((char)34)+CRLF+
        "Content-Disposition: attachment; filename="+((char)34)+attFname[i]+((char)34)+CRLF+
        "Content-Transfer-Encoding: Base64"+CRLF+CRLF+attContent[i]+CRLF;
    output+="--"+getBoundary(container)+CRLF;
    result.addValue(output);
    This UDF is configured as "QUEUE"
    We have configured this input-structure
    The Content itself is allready base64.
    So we can call this mapping and it creates a Multipart-Mail for us.

  • States in graphic styles

    Hi
    I tried to use graphic styles to save  the states of an menu-enty or a input field - and failed. So it's not possible to safe different states in one graphic style?

    That's a logical answer but unfortunately it's not the case in this matter. For instance I tried out one of the Graphic Styles which contained several elements which were not introduced in newer versions, such as Drop Shadow and Offset Path... even just saving as AI CS5, the problem was happening.

  • How to deal with non-continuous shapes and graphic styles

    I am not sure how to frame this question so I will try to describe the problem.
    Imagine I have two shapes. One is a hollowed out circle (like a doughnut chart). The second is a smaller filled in circle. The smaller filled in circle is then poitioned inside the hoolowed out one, so you have like a target but with no "middle" band. What I would like to do is apply a graphic style to the COMBINED shape. The problem is that if I select both shapes and apply the style, each shape will have its own style, whereas what I want is for the style to be distributed over the two shapes as if they were one. And if I use the shape builder tool, when I join the two shapes, from the outer hollowed out circle to the inner filled in circle, I fill in the shape for the "middle band" whereas I want that middle band to be empty.
    You can probably tell I don't know Illustrator and come from Photoshop. In PS, I would simply select my two shapes and apply a style. Since my selection forms a shape that ignores the middle band, the style applies evenly to the whole selection. Can I do something similar in Ilustrator? In reality my network of shapes is more complex that the example above and I do need to keep it a vector.
    Thank you for your suggestions.
    Chris

    There are really two types of Graphic Styles - Object level styles and Group level styles. There is no way to tell which style is which. So if you have an Object level Style and try to apply it to a group of objects or often a compound shape, you get each individual object having the style. If you have a Group level style and try to apply it to only an object, you often get nothing applied.
    It perhaps sounds like you have an Object level style and are trying to apply it to a group.
    There's no way to convert an Object level style to a Group level style or vice versa. The best (and pretty much only) way I've found to get around this is to apply the style to teh correct level then make a note of all the style settings, select the other level and recreate the style for that level.
    Whether or not a style applies correctly has a great deal to do with specific aspects of the style in addition to what level the style was generated from. This is a frustrating aspect of Graphic Styles.

  • Can't locate custom Graphic Styles

    I created and saved some custom Graphic Styles in Illustrator CS4. When I follow the path of the default save location (Apps>Illustrator>Presets>en_US>Graphic Styles) they are not there. I have used Spotlight to search my machine for the files, but it returns no results.
    I have created a new, custom location for saving Graphic Styles in the future, but I want to locate these "missing" files so that I can delete them.
    Anyone know how to locate these files?
    Can I locate and remove them from within Illustrator?
    I am using Illustrator CS4 for Mac.
    Thanks.

    Thanks for the reply Mylenium.
    I still don't see them.
    User>Library>Preferences>Adobe>...nothing about Illustrator (Encore, Encoder, AE, Contribute, EXT Mgr, MediaCore ImporterProcess, OnLocation, Plugins, PProHeadlines, PPro, SB, XMP). I checked each of these folders and their subfolders with no luck.
    User>Library>Preferences>Adobe Illustrator CS4 Library Settings>en_US>Flash 10 and FWAIPref>...empty.
    User>Library>Preferences>Adobe Illustrator CS4 Settings>en_US>...no folders and no Graphic Styles.
    Weird.

  • Need help in the using VBA in BPS

    Hey here i have a problem in layout in using VBA(visual basic for applications)...
    i have created a layout using 5 keyfigures from cube and i included two calculated columns along with them, and am also using a variable for 0 calweek here, here when i execute the layout all the data for 5keyfigures gets aggregated but the data for the added two columns are not getting aggregated...i know i have to use VBA in solving this issue but i have no idea abt VBA, can anybody help me in solving this issue...i guess the first columns in the layouts should be the keyfigure from the cube...please help me in solving this issue

    Hi,
    My actual requirement is on using a variable for 0calweek...i mean i have created a layout where i use a variable to to see the data on weekly basis...i have created a variable to on 0calweek to see the selected weeks data...here in the layout i have created two calculated columns where this variable will not work for this two columns as its data is not coming from the cube...i have done layout for 26weeks...when i select from and to weeks between 1 to 6weeks all the data can been seen till6th week but the data for the two added columns is showing for all the weeks from 1 to 26th week...it is not getting aggregated to 6 weeks...i want to see selected data for those two columns data also....i guess you got my point...
    Thanks in advance...

  • Refer to a Graphic Style in a Graphic Style library

    Is it possible to use Javascript to apply a Graphic Style from a save Graphic Style library to an object.
    Or does it have to be in the default graphic styles panel to refer to it in JS.
    Thanks.

    What happens if you try it?
    I think this is your answer: under Document properties, I find
    graphicStyles
    ArtStyles
    readonly
    The graphic styles defined in this document.
    (my emphasis)

  • Copy/Paste duplicates graphic styles

    Scenario: Start with a named graphic style of say 2 pt black stroke/no fill called '2.0 pt'. Create an object using said style, copy and paste it, every time I do this I get '2.0 pt 1', '2.0 pt 2', '2.0 pt 3' etc. insanely populating my graphic styles panel. Anybody else experience this behaviour or is it just my set up and something I have to troubleshoot?
    This is with CS6 (16.0.4) running on Mac OS X.6.8
    Any help, much appreciated
    Les

    Yeah, sorry about that, tried to edit my post to reflect that I was in the wrong forum but the forum software said I didn't have permission to edit my own post! weird. And yes I'm talking about Illustrator.
    Les

  • Applying a graphics style to object in extendscript

    Hi
    I've looked around but can't find anything on this although I'm sure its pretty straightforward.
    How do I apply a graphic style (pre defined in the GRAPHIC STYLES palette as 'Line 1) to an object, say rectangle, called 'rectangle1' using extendscript.
    Can't work this out. (In illustrator CS5 bye the way)
    Thanks
    Bob

    here's a sample, graphic style "add" applied to Selection
    var idoc = app.activeDocument;
    var sel = idoc.selection[0];
    var addStyle = idoc.graphicStyles['add'];
    addStyle.applyTo (sel);

Maybe you are looking for

  • [solved] gnome3 only in fallback mode

    There a few threads dealing with similar problems, but they are rather old. So I decided to open a new topic. gnome3 only starts in fallback-mode on my notebook (Lenovo TP x61). I cleaned up my xinitrc and use gdm to start gnome, but still no results

  • ME9F - PO Output Report

    Dear MM Gurus, When I execute the transaction ME9F with the necessary inputs (like PO, Output Type etc.), in the output it does not show any condition type values in the form. Is there any alternative way to bring in the condition type values in the

  • LR3.2 export - no more EXIF data on JPEG

    Hello everybody, trying to get some help... My setup: iMac 24 running OSX 10.5.8 and Mac Book Pro 15" same OSX. In both I'm using LR 2 for years, and couple of weeks ago I purchased the LR3.2 My photographs are in my galleries in Smugmug. The images

  • Ipad wont sign into app store, safari pages not loading

    I bought an ipad 2 used. It wont sign into itunes store or app store and safari isnt loading anything. I am connected to a working wifi. It is signed into my icloud, and facetime. When signing into imessage it says check network connection. Then veri

  • CSM without any sticky

    I have set up a real basic configuration with a verver on port 80 pointing to a serverfarm with two servers. I have no sticky enabled and no persistent rebalance on the vserver. If I go to the URL that points to the VIP the connection is made with th