Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
RubenTenerife
New Member.
1290 views

USING MICROSOFT WORD NUMBERED LIST

Hello,

I'm creating a Word file and trying to insert a numbered list by using a cobol definition of Word.

I've created a very simple Word macro but I can not translate to Cobol.

Can anybody help me?

This is the macro code:

    ListGalleries(wdNumberGallery).ListTemplates(1).Name = ""
    Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _
        ListGalleries(wdNumberGallery).ListTemplates(1), ContinuePreviousList:= _
        False, ApplyTo:=wdListApplyToWholeList, DefaultListBehavior:= _
        wdWord10ListBehavior
    Selection.TypeText Text:="TEST"

Thanks!!

0 Likes
1 Reply
luispaul Absent Member.
Absent Member.

RE: USING MICROSOFT WORD NUMBERED LIST

inquire word-app, @ListGalleries

                              in word-ListGalleries.

          modify word-ListGalleries, @Item = 2

                                     giving word-ListGallery.

          inquire word-ListGallery, @ListTemplates in

                                     word-ListTemplates.

          modify word-ListTemplates, @Item = 1

                          giving word-ListTemplate.

          inquire word-ListTemplate, @ListLevels

                          in word-ListLevels.

          modify word-ListLevels, @Item = 1 giving word-ListLevel.

          modify word-ListLevel,

                      @NumberFormat = "%1.",

                      @TrailingCharacter = wdTrailingTab,

                      @NumberStyle = wdListNumberStyleArabic,

                      @NumberPosition = 28,35,

                      @Alignment = wdListLevelAlignLeft,

                      @TextPosition = 28,35,

                      @TabPosition = 28,35,

                      @ResetOnHigher = 0,

                      @StartAt = 1.

          modify word-ListTemplate, @Name = "".

          modify word-app, @Selection::Range::ListFormat::

                  ApplyListTemplate(word-ListTemplate, 0, 1, 1).

          modify word-app, @Selection::TypeText ="esto es".

          modify word-app, @Selection::TypeParagraph().

          MODIFY word-app, @Selection::TypeText ="Nada".

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.