Setting SpaceAfter property with Word ActiveX

I am using the wordreport and Microsoft Word Object 9.0 Object Library instruments to generate a report.  I would like set the paragraph Space Before and Space After properties before generating my report.  In Word this is part of the paragraph formatting options.  I want to set both to 0 for my report.  According to the documentation on MSDN, these properties are part of the Paragraph collection in the ActiveX (the following is from http://msdn.microsoft.com/en-us/library/office/bb208789%28v=office.12%29.aspx):
Switching the space before a paragraph between 12 points and none
The following example toggles the space-before formatting of the first paragraph in the selection. The macro retrieves the current space before value, and if the value is 12 points, the space-before formatting is removed (the SpaceBefore property is set to zero). If the space-before value is anything other than 12, the SpaceBefore property is set to 12 points.
Sub ToggleParagraphSpace()
With Selection.Paragraphs(1)
If .SpaceBefore <> 0 Then
.SpaceBefore = 0
Else
.SpaceBefore = 6
End If
End With
End Sub
I cannot find a function in the ActiveX library that sets this property. There are several Paragraph and Selection formatting functions, but none for Space Before or Space After.  Is it possible to set these properties through the ActiveX control?
Tony G.

Daniel,
Thanks!  That's exactly what I was looking for.  I didn't realize it was hidden in the SetProperty function.  It seems odd that the ActiveX library includes paragraph formatting functions like ParagraphFmtTabIndent and ParagraphFmtSpace1, but it doesn't have explicit functions for SpaceBefore and SpaceAfter. 
For the benefit of anyone else who might be following this thread, I had to add a few functions to get some additonal ActiveX collection handles.  Here's what the final code looks like:
** GenerateLogFile **
void GenerateLogFile(void)
    CAObjHandle DocHandle;  
    CAObjHandle AppHandle;
    CAObjHandle CurrentSelectionHandle;
    CAObjHandle ParagraphFormatHandle;
    WordRpt_ApplicationNew(VTRUE, &AppHandle);
    WordRpt_DocumentNew (AppHandle, &DocHandle);
    WordRpt_SetReportLineSpacing (DocHandle, 1);
    Word_GetProperty (AppHandle,
                      NULL,
                      Word_ApplicationSelection,
                      CAVT_OBJHANDLE,
                      &CurrentSelectionHandle);
    Word_GetProperty (CurrentSelectionHandle,
                      NULL,
                      Word_SelectionParagraphFormat,
                      CAVT_OBJHANDLE,
                      &ParagraphFormatHandle);
    Word_SetProperty (ParagraphFormatHandle, NULL, Word_ParagraphsSpaceBefore, CAVT_FLOAT, 0.0);
    Word_SetProperty (ParagraphFormatHandle, NULL, Word_ParagraphsSpaceAfter, CAVT_FLOAT, 0.0);
    // create report using functions like WordRpt_AppendLine and WordRpt_InsertImage       
    CA_DiscardObjHandle(AppHandle);
    CA_DiscardObjHandle(DocHandle);
    CA_DiscardObjHandle(CurrentSelectionHandle);
    CA_DiscardObjHandle(ParagraphFormatHandle);
} /* GenerateLogFile */
I have one last problem.  I've run this program on three different PCs.  All three are running the same versions of Windows 7 and Word 2007.  And yet on one of the three PCs, the WordRpt_InsertImage function doesn't work.  All the other text in the log file is present, but the bitmaps don't get inserted.  I thought that maybe there was a difference in the ActiveX control versions, but I can't find a way to determine what version of the ActiveX is intalled on each machine.  Or is there something else I should be looking at?
Tony G.

Similar Messages

  • How do I set document property with delay using jquery?

    56     $("#DivStage2").delay(11000).fadeIn(1000);
    57     $("#DivStage2").delay(56000).fadeOut(1000); //11000 to 69000
    58     < need code here > 
      I have document item as defined below
      document.getElementById('2').setAttribute("style", "color: #FFF;");
    I want this to run on line 58 above with a delay before it of 4 seconds after line 56 starts.
    Please can anyone advise.
    Thank you in advance for any feedback and for everyone who has helped me so far on previous enquiries.
    I've ordered a jquery book which might help me, but I'm still learning.
    Terry

    terryfoster wrote:
    Okay I have
       <div id="DivStage2" >
        <h2 id="1" style="color: #707070;">Topic1</h2>
        <h2 id="2" style="color: #707070;">Topic2</h2>
      </div>
    Now in the function above I have...
    $("#DivStage2").delay(1000).fadeIn(1000);              // delay 1 sec then fade in for 1 sec
    $("#DivStage2").delay(56000).fadeOut(1000);         // keep this div onscreen for 56 secs then fadeout 1 sec
    Now after 20 seconds I want to turn Topic2 white as this is the one I want to focus on.....
    and topic1 grey again
    I would have thought......
             $("h2 #2").delay(20000).css("style", "color: #FFF;").delay(20000);
    would have turned the second topic white but No.... It does nothing at all
    (hmm why does everything I cut and paste end up in a table here now!!! What a bother editing!)
    Thank you
    It wont do anything because that function will only be executed after the <div> has faded out if it comes after
    $("#DivStage2").delay(56000).fadeOut(1000);

  • Having problem setting system property with java -D name = value

    I want some clarification. Consider the statement below
    java -Djava.rmi.server.codebase=file:/c:\public_html\classes/
    -Djava.rmi.server.hostname=xyz.com
    -Djava.security.policy=java.policy engine.ComputeEngine
    1. Is the syntax right for specifying a file directory as codebase?
    -Djava.rmi.server.codebase=file:/c:\public_html\classes/
    2. What does this hostname property imply? Does this mean that the program which is started can be accesed by xyz.com?
    -Djava.rmi.server.hostname=xyz.com

    Kurt,
    I modified some of my directory structure as shown below and tried to execute. But I have got the same error again. Could you tell how to correct this error?
    Under c:\home\ann\public_html\classes directory, I have the Following:
    Sub-directory compute [Contains Compute.class and Task.class File]
    Sub-directory engine [Contains ComputeEngine_Skel.class and ComputeEngine_Stub.class Files]
    Sub-directory Meta-inf [Contains Manifest.mf file]
    File compute.jar
    Under c:\home\ann\src directory, I have the following:
    Sub-directory engine [Contains ComputeEngine.java, ComputeEngine.class]
    File java.policy
    Under c:\home\jones\public_html\classes directory, I have the Following:
    Sub-directory client [Contains Pi.class File]
    Current working directory is c:\home\ann\src
    The output from echo %CLASSPATH% was c:\home\ann\src; c:\home\ann\public_html\classes\compute.jar
    When executing the command:
    java -Djava.rmi.server.codebase=file:/c:\home\ann\public_html\classes
    -Djava.rmi.server.hostname=bwing2
    -Djava.security.policy=java.policy engine.ComputeEngine
    I am getting the error,
    ComputeEngine Exception: Stub class not found: engine.ComputeEngine_Stub; nested exception
    is : java.lang.ClassNotFoundException: engine.ComputeEngine_Stub
    java.rmi.StubNotFoundException: Stub class not found:
    Sridhar

  • How can I set a property when an event happens? (selection changed on datagrid)

    I have a datagrid, I would like to change the backgrund of the datagrid when the selection changed event is fired.
    I can not use data trigger, because is in the case that I expected a value, but in this case is when change, to any value.
    An option is to use an event trigger, but all the examples that I have found is to use with an actions, and I just want to set a property.
    How could I do that?
    I am using MVVM pattern, so I would like to avoid the use in code-behind.
    Thank so much.

    You could use an event trigger and implement your own TriggerAction<T> that sets the background property. There is an example of how to create a custom TriggerAction available here:
    http://stackoverflow.com/questions/942548/setting-a-property-with-an-eventtrigger.
    The following example sets the Background property of the DataGrid to a red SolidColorBrush when the SelectionChanged event is fired. It should give you the idea:
    <DataGrid x:Name="dgrid"
    xmlns:local="clr-namespace:WpfApplication22">
    <i:Interaction.Triggers>
    <i:EventTrigger EventName="SelectionChanged">
    <local:SetPropertyAction PropertyName="Background" TargetObject="{Binding ElementName=dgrid}">
    <local:SetPropertyAction.PropertyValue>
    <SolidColorBrush>Red</SolidColorBrush>
    </local:SetPropertyAction.PropertyValue>
    </local:SetPropertyAction>
    </i:EventTrigger>
    </i:Interaction.Triggers>
    <DataGrid.Columns>
    namespace WpfApplication22
    public class SetPropertyAction : TriggerAction<FrameworkElement>
    public string PropertyName
    get { return (string)GetValue(PropertyNameProperty); }
    set { SetValue(PropertyNameProperty, value); }
    public static readonly DependencyProperty PropertyNameProperty
    = DependencyProperty.Register("PropertyName", typeof(string),
    typeof(SetPropertyAction));
    public object PropertyValue
    get { return GetValue(PropertyValueProperty); }
    set { SetValue(PropertyValueProperty, value); }
    public static readonly DependencyProperty PropertyValueProperty
    = DependencyProperty.Register("PropertyValue", typeof(object),
    typeof(SetPropertyAction));
    public object TargetObject
    get { return GetValue(TargetObjectProperty); }
    set { SetValue(TargetObjectProperty, value); }
    public static readonly DependencyProperty TargetObjectProperty
    = DependencyProperty.Register("TargetObject", typeof(object),
    typeof(SetPropertyAction));
    protected override void Invoke(object parameter)
    object target = TargetObject ?? AssociatedObject;
    PropertyInfo propertyInfo = target.GetType().GetProperty(
    PropertyName,
    BindingFlags.Instance|BindingFlags.Public
    |BindingFlags.NonPublic|BindingFlags.InvokeMethod);
    propertyInfo.SetValue(target, PropertyValue);
    For more information about how to hook up event triggers and handle events in MVVM, please refer to my blog post:
    http://blog.magnusmontin.net/2013/06/30/handling-events-in-an-mvvm-wpf-application/
    Please also remember to mark helpful posts as answer.

  • Setting nevershare property

    I have messy metadata flowing into my Planning app. Many Parents have only one child so I need to set to NeverShare.
    Too much work to do on the PL/SQL side.
    Can I just set the property with the Essbase JAVA API?
    Suggestions?
    Jz

    The essbase java API is for essbase, you need to update the property on the planning side.
    Though there is an essbase config setting that can override the never share property - http://docs.oracle.com/cd/E26232_01/doc.11122/esb_tech_ref/impliedshare.html
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Word property with multiple lines

    Good Morning,
    I have a Document Library with an Word template, I fill some properties of the library so I can put this properties in the template. I am trying to write a line break, Any idea?
    Thanks.

    Hi,
    According to your post, my understanding is that you want to use Word property with multiple lines.
    Per my knowledge, you can remove two updates: KB2760769 and
    KB2760758.
    The working version of office is 14.0.6129.5000.
    Here is a similar thread for your reference:
    http://sharepoint.stackexchange.com/questions/77759/inserting-multi-line-text-field-quick-part-from-sharepoint-crashes-word
    More information:
    Office 2010 Update KB2760758 Incorrectly Checks Multi-Line Columns
    As this question is more relate to Word, I suggest you post it to the corresponding forum, you will get more help and confirmed answers from there.
    http://social.technet.microsoft.com/Forums/en-US/home?forum=officesetupdeployprevious
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How do I set the default value to 0 in a property with "money" as the type?

    I have an entity with several properties with the "Money" data type.  I also have a Money property with a "computed" value that shows the sum of the other money type properties. However, a total will not display if any of the other
    fields are left with a null value. Is there way to make the default value set to "0"?  I am using c#.  Thank you.

    Mark, there's a very basic .NET method on every nullable object:
    GetValueOrDefault
    EDIT: Now I see...please avoid duplicating
    questions...
    To be clear:
    Put GetValueOrDefault on every nullable field used inside your 'TotalDue_Compute' sub
    You don't need to define 'TotalDue' as Nullable anymore

  • Sharepoint 2013 webDAV PROPPATCH fails with status code 409 error every time when trying to set custom property.

    Sharepoint 2013 webDAV PROPPATCH fails with status code 409 error every time, when trying to set custom property.
    anyone have any idea

    Hi
    Stumbled upon the resolution myself. The Bean Area item needs to be set to Visible=Yes in the property palette for the bean within Forms Builder, and also the implementation class also in the bean's properties must match exactly the package & class name specified in the PJC (my full implementation class string had to be set to oracle.forms.demos.runApplication).
    As this bean has no user interface component, and since the Visible property has to be set to Yes, to avoid having a random square shape for the bean sitting on the form's canvas, I also set the Width and Height properties for the bean to 0.001. This does show a very small dot on the form, but that will be acceptable.
    So in summary there has been a change for PJC / Bean Areas between 6i and 10g Forms, in 6i you could have the Bean Item to be set Visible=No, and the SET_CUSTOM_ PROPERTY built-in would work, however in 10g Forms the Bean Item must be set to Visible=Yes for the SET_CUSTOM_PROPERTY built-in to work.
    Daryl

  • What is the best way to work with Word documents in The InDesign CS4???

    I work in Microsoft Word 2007 and all my documents have *.doc format.
    What is the best way to work with Word documents in InDesign CS4???
    David Blatner says to avoid copying and pasting text from Word instead of placing it (Ctrl+D).
    How about pasting RTF or Text Document???
    I want to make book's layout in ID CS4 and its main feature is that there is the left page with text and the right - with graphics.
    So, as I understand to place the text on each page I must create for example 70 Word documents and place each item on 70 left pages???
    It loks like wasting time. I sthere another way of making such layout???  What kind????

    It's best to place any text.
    You can have all of your text in one file and use auto-flow to add threaded text frames and pages as required (Hold down the Shift key when you click the loaded text cursor), but it's a little non-standard to have the thread only on one side of the spread from the auto-flow perspective, so you'll have to set up properly.
    This is one case where a master text frame will work to your advantage. On your master page spread, add a text frame to the left page, but not to the right (or at least not threaded to one on the right -- for some other project you might actually want two independent text threads). Hold the loaded cursor over a frame on the left side of a document page and auto-flow. ID will add new spreads as necessary, but only put the text on the left side.
    Peter

  • How to set tabstops in MS Word using the LabVIEW Report Generation Toolkit

    Using the Report Generation Toolkit of LabVIEW, I need to set multiple tabstops that very in distance in MS Word.  I also have different sets of tabstops that I use and re-use at different times in the same report.  Is there a way to set the tabstops under program control?  I searched through the various VIs and found that there is a property ("Tabstops", "Word.Tabstops") in the _ParagraphFormat property node that refers to tabstops.  I found it in the Word Format Paragraph (adv) VI.  Unfortunately, I could not determine how to use it.  Any suggestions?  Is this an operational element?

    Bluebell,
    Sounds like you've already done some fantastic work to expose the various properties and methods of MS Word. It took me about 20 min before I could find the specific property that you were talking about! I found it under Word.Document>>Paragraphs>>Tabstops>>Add. There is a position, alignment and leader parameter that you can set from this property node. I've found that the best way to discover what these parameters do is to simply experiment. You could also try using the macro recorder in Word, perform the specific task, and then look at the code generated. I'm guessing that position sets the position of the tabstop itself. It sounds like your application is really specific. For such a specific task, I think I'd write a macro and call that macro from LabVIEW.
    Chris Cilino
    National Instruments
    LabVIEW Product Marketing Manager
    Certified LabVIEW Architect

  • RoboHelp for Word installed from RoboHelp 10 won't work with Word 2010

    I have a Help project created in RoboHelp for Word 8.  I recently upgraded from Word 2007 to Word 2010 and discovered that RH8 for Word won't work with Word 2010.  So I purchased RoboHelp 10 and have installed RoboHelp for Word from it.  Alas, RH for Word STILL won't work with Word 2010.  When I try to open my project, I get this message:
    Before I bought RH10, I live-chatted with an Adobe sales person who assured me it was compatible with Word 2010.
    BTW, I tried to roll back to Word 2007, but I was getting weird behavior running Word, so I have reinstalled Word 2010 and want to stay there.
    Any ideas?

    I have just installed Rh10 for Word on a new machine and initially I got this message.
    I wonder if you have followed those instuctions? I changed the setting to Enable All.
    The other possibility is what do you have set for the default version? If it is 2007 and that no longer exists on your machine, then Rh will not be able to proceed. The dropdown should show 2010
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • How do I set ClientCredentials property to windows credentials?

    As per MSDN
    http://technet.microsoft.com/en-us/library/92a9678c-bc4f-4d7a-ba44-85989bfe27ca
    Building Applications Using the Reporting Web Service and the .NET Framework we have to set Credentials as below
    ReportingService2010 rs = new ReportingService2010();
    rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
    However, after creating the proxy I don't see proxy has Credentials property as MSDN says. The proxy has ClientCredentials property but it is not derived from ICredentials
    I'm using http://serverurl/ReportServer/ReportService2010.asmx
    How do I set ClientCredentials property to windows credentials in this case?

    But i dont see "Add web reference" option.
    Have you read the link I posted? "Add Service Reference" => button "Advanced" => "Add Web Reference"
    to check if the folder already exists
    Sure, with
    ReportingService2010.ListChildren
    Method
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Uses for the Action Property with SQL and Oracle DB Adapters

    This thread is a complement to the Wiki Article
    BizTalk: Streamlining WCF SQL and Oracle Messaging-Only and Other Patterns
    The question.  In what circumstances is explicitly setting the Action value with the WCF SQL and Oracle DB bindings useful or beneficial. 
    A complimentary question.  Is it even possible to set the Action value to anything other than exactly what is required by the Message.
    I ask because of three very specific behaviors of the bindings themselves:
    The binding enforces a match between the Action and the Message, therefore...
    There is a one-to-one relationship between the Message and Action, but...
    The binding is able to correctly derive and perform the requested operation with the unspecific CompositeOperation.
    For clarity, I understand how to set the Action. I. understand what the Action represents in the SOAP scheme. I understand how Action can be used as an abstraction for SOAP operations.
    Thoughts?

    Do you have any good suggestion to learn how to use action property with SQL and Oracle DB adapters?  I learn a lot from your replies for years in BizTalk forum. :)

  • Windows installer sets VersionNT property to 603

    Hello,
    OS: Windows 10 Technical Preview
    I've got msi package, which has LaunchConditions based on VersionNT(64) property, but installer sets this property to 603 (corresponding to Win8.1\2012r2). I wrote custom action, where I call VerifyVersionInfo function, and on 9879 build it worked,
    but starting from 9926 It doesn't. It seems that VerifyVersionInfo now requires proper GUID in manifest file, that is not possible for binary custom action. What is the proper way to detect Windows 10 version in msi package?
    I tried to ask this question at Windows Insider Program, but i was suggested to ask it here.
    Thank you.

    Hello,
    OS: Windows 10 Technical Preview
    I've got msi package, which has LaunchConditions based on VersionNT(64) property, but installer sets this property to 603 (corresponding to Win8.1\2012r2). I wrote custom action, where I call VerifyVersionInfo function, and on 9879 build it worked, but starting
    from 9926 It doesn't. It seems that VerifyVersionInfo now requires proper GUID in manifest file, that is not possible for binary custom action. What is the proper way to detect Windows 10 version in msi package?
    I tried to ask this question at Windows Insider Program, but i was suggested to ask it here.
    Thank you.
    Hello,
    1. Windows 10 has not been official released that there is not a solid version for us to detect, and currently issues related to windows 10 are not supported, you could consider submitting this feedback with the
    Give us feedback part shared in the following document.
    http://windows.microsoft.com/en-us/windows/preview-updates-feedback-pc
    2. It's not clear which publishment you are using, if possible, you could share the detailed information like the tool to publish your project and the configuration in that feedback.
    Thanks for your understanding.
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How compatible is Oracle forms with OCX / ActiveX components

    How compatible is Oracle forms 6.0 with OCX / ActiveX components?
    IFve got to very nice activeX controls (ctSchedule and ctMday)
    from DBI-TECH(www.dbi-tech.com) but they donFt work properly
    within Forms. They work great within VBA (word).
    Sometimes they donFt display things well or donFt react to the
    mouse in the properly manner.
    What can be wrong os is Oracle forms not 100% activeX compatible.
    Thanks
    Guido Reulen
    [email protected]
    null

    Hi b w,
    I do not know much about Simply Accounting, however, if the Crystal Reports can be integrated with this software, then their tech support would be the best one to answer the issue with limited access to reports.
    Secondly, if you can get an ODBC driver for your Simply Accounting, you might be able to create reports in Crystal reports (Again with no guarantee as Simply Accounting does not fall in the supported platforms for Crystal Reports).
    I would suggest you to contact the tech support of Simply Accounting to know if there is any specific version of Crystal reports that works best with your software.
    It is simple to create highly professional reports with Crystal reports and you can either refer to the help included with the software or can log on to SAP support site and download the Crystal Reports user's guide to get step by step instructions on creating reports.
    Please do let us know if you have any further questions.
    Regards,
    Abhishek Jain.

Maybe you are looking for