<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Word ole Question Problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/word-ole-question-problem/m-p/416940#M11308</link>
    <description>&lt;P&gt;Ask the users if they can use the format .DOCX (the classic contraindication is that some of the target users have an old MS Word software version, which can't open .DOCX documents). If it's possible, they just have to save their template into .DOCX, nothing more.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jul 2017 20:16:37 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2017-07-06T20:16:37Z</dc:date>
    <item>
      <title>Word ole Question Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/word-ole-question-problem/m-p/416935#M11303</link>
      <description>&lt;P&gt;HI all, &lt;/P&gt;&lt;P&gt;Could you help me with solving a similar problem? I need to delete a row from a Table in WORD document.. I've recorded the macro in Word , but did not manage to translate it correctly to ABAP. What's wrong below? Please, help. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;This is the macro VBA:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;* 
sText = InputBox("Enter text for Row to be deleted")&lt;/P&gt;&lt;P&gt; 
Selection.Find.ClearFormatting&lt;/P&gt;&lt;P&gt;With Selection.Find&lt;/P&gt;&lt;P&gt;  .Text = sText&lt;/P&gt;&lt;P&gt;  .Wrap = wdFindContinue&lt;/P&gt;&lt;P&gt; 
End With&lt;/P&gt;&lt;P&gt; 
Do While Selection.Find.Execute&lt;/P&gt;&lt;P&gt;  If Selection.Information(wdWithInTable)
Then&lt;/P&gt;&lt;P&gt;  Selection.Rows.Delete&lt;/P&gt;&lt;P&gt;  End If&lt;/P&gt;&lt;P&gt; 
Loop&lt;/P&gt;&lt;P&gt;---------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;EM&gt;This is my Abap Code .&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data: clear      type ole2_object. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data: word       type ole2_object. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data: execute    type ole2_object.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;
data: information type ole2_object. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data: row        type ole2_object. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data: selection  type ole2_object.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;
data: find       type ole2_object,
      wdFindContinue type ole2_object, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;      delete TYPE ole2_object. .&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CALL METHOD OF h_word 'ClearFormatting' = clear. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GET PROPERTY OF clear 'Selection' = selection.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;
GET PROPERTY OF selection 'find' = find. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SET PROPERTY OF find 'Text' = ' (D)'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SET PROPERTY OF find 'Wrap' = wdFindContinue.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;
CALL METHOD OF find 'Execute' = execute.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GET PROPERTY OF selection 'Information' = information. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set PROPERTY OF selection 'Rows' = row. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CALL METHOD of row 'Delete' .&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 17:50:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/word-ole-question-problem/m-p/416935#M11303</guid>
      <dc:creator>former_member474827</dc:creator>
      <dc:date>2017-07-05T17:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Word ole Question Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/word-ole-question-problem/m-p/416936#M11304</link>
      <description>&lt;P&gt;You must swap a few things in the first lines.&lt;/P&gt;&lt;P&gt;Assuming you have correctly created the object H_WORD, you must then do:&lt;/P&gt;&lt;P&gt;For &lt;STRONG&gt;selection.find.clearformatting&lt;/STRONG&gt; :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;GET PROPERTY OF h_word 'Selection' = selection.
GET PROPERTY OF selection 'find' = find. 
CALL METHOD OF find 'ClearFormatting'. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Etc.&lt;/P&gt;&lt;P&gt;But why don't you go for &lt;STRONG&gt;abap2xlsx&lt;/STRONG&gt;. It's more easy for a developer, much faster, and it works in background. But you can't create your code from the VBA, you must create the code from scratch (and eventually reuse a template workbook if you want).&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 01:48:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/word-ole-question-problem/m-p/416936#M11304</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-07-06T01:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Word ole Question Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/word-ole-question-problem/m-p/416937#M11305</link>
      <description>&lt;P&gt;Thanks Sandra for the answer.&lt;/P&gt;&lt;P&gt;The problem is that the format of the documents must be '.DOC' . i know that to use &lt;STRONG&gt;abap2xlsx  &lt;/STRONG&gt;is more simple but my template word can't be changed (it has been done ad HOC ).&lt;/P&gt;&lt;P&gt;I'll try to use your code and i'll know you .&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 07:43:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/word-ole-question-problem/m-p/416937#M11305</guid>
      <dc:creator>former_member474827</dc:creator>
      <dc:date>2017-07-06T07:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Word ole Question Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/word-ole-question-problem/m-p/416938#M11306</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;
  
  GET PROPERTY OF h_word 'Selection' = selection.
  GET PROPERTY OF selection 'Find' = find.
  CALL METHOD OF find  'Text' " 'ClearFormatting'
      EXPORTING #01 = 'Mobility'
                #02 = 'wdFindContinue'.


  GET PROPERTY OF h_word 'Selection' = selection.
  GET PROPERTY OF selection 'Find' = find.
  CALL METHOD OF find 'Execute'.


*  GET PROPERTY OF h_word 'Selection' = selection.
*  CALL METHOD OF selection 'Information'
*        EXPORTING #01 = 'wdWithInTable'.


  GET PROPERTY OF h_word 'Selection' = selection.
  GET PROPERTY OF selection 'Rows' = row.
  CALL METHOD OF row 'Delete'.


&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; Hi Sandra,&lt;/P&gt;&lt;P&gt; I have inserted this code in my Abap Report but it doesn't work:(&lt;/P&gt;&lt;P&gt; Where am I wrong ????&lt;/P&gt;&lt;P&gt; Thanks &lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 10:35:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/word-ole-question-problem/m-p/416938#M11306</guid>
      <dc:creator>former_member474827</dc:creator>
      <dc:date>2017-07-06T10:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Word ole Question Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/word-ole-question-problem/m-p/416939#M11307</link>
      <description>I don't know where you have seen that "text" was a method of "find". Use the VBA Object Explorer (F2) to determine whether they are properties or methods:&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/46524-uwebl.png" /&gt;&lt;/P&gt;&lt;P&gt;So, "text" is a property, then you need to use SET PROPERTY OF find 'text' = 'Mobility' (mobility is the text you want Word to search).&lt;/P&gt;&lt;P&gt;You can't pass the constants wdFindContinue and other ones literally, you must pass their corresponding integer values. Use the VBA Object Explorer (F2) to display their real values. wdFindContinue value is 1, so you pass #2 = 1&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/46521-cj4oo.png" /&gt;&lt;/P&gt;&lt;P&gt;But wdFindContinue is a constant for attribute Wrap, so you must use: SET PROPERTY OF find 'Wrap' = 1.&lt;/P&gt;&lt;P&gt;Be very rigorous when you convert manually VBA to ABAP, to keep the same coherence.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 20:12:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/word-ole-question-problem/m-p/416939#M11307</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-07-06T20:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Word ole Question Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/word-ole-question-problem/m-p/416940#M11308</link>
      <description>&lt;P&gt;Ask the users if they can use the format .DOCX (the classic contraindication is that some of the target users have an old MS Word software version, which can't open .DOCX documents). If it's possible, they just have to save their template into .DOCX, nothing more.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 20:16:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/word-ole-question-problem/m-p/416940#M11308</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-07-06T20:16:37Z</dc:date>
    </item>
  </channel>
</rss>

