I need to try a macro, because TextMaker converts body text to headers when a selection including body text is demoted.
I tried AI, but the variables were unrecognized.
So... CoPilot recommended I ask this way, under the impression that maybe my subscription to SoftMaker Office NX does not include what I need to do this kind of macro.
"Does TextMaker NX Home expose the document object model (ActiveDocument, Selection, Paragraphs, Style, OutlineLevel) in BasicMaker? If not, is there any supported way to select only headings or promote outline levels via macro?"
I'm using TextMaker NX Home (rev S1502.0808) 64bit in Windows 10.
- - - - - The AI-generated macro (that didn't work in my version of TextMaker - - - - -
Sub PromoteSelectedHeadingsOnly
Dim sel As Selection
Dim p As Paragraph
Dim styleName As String
Dim lvl As Integer
Set sel = ActiveDocument.Selection
' Loop through all paragraphs in the selection
For Each p In sel.Paragraphs
styleName = p.Style.Name
' Check if the paragraph style matches "Heading X"
If Left(styleName, 7) = "Heading " Then
' Get current outline level
lvl = p.OutlineLevel
' Promote only if not already at top level
If lvl > 1 Then
p.OutlineLevel = lvl - 1
End If
End If
Next p
End Sub
Macro troubleshooting: Promoting headers
Re: Macro troubleshooting: Promoting headers
I am guessing this is related to this post. AS I asnwered there, I think you came across a bug.
I do not use NX, not do I use Windows, witch rules out me trying whatever is going on with your macro, however... Copilot is terrible (in general, for everything), and the macro it made for you is probably tailored to MS Office and it is assuming that TextMaker and BasicMaker works the same way as MS Office macros. That's AI for you...
I do not use NX, not do I use Windows, witch rules out me trying whatever is going on with your macro, however... Copilot is terrible (in general, for everything), and the macro it made for you is probably tailored to MS Office and it is assuming that TextMaker and BasicMaker works the same way as MS Office macros. That's AI for you...
Re: Macro troubleshooting: Promoting headers
Thank you for your post.
To investigate this properly, please attach a small sample document showing the relevant headings and body text, and confirm whether the macro in your first post is the version you are currently using. Please also describe the result you expect, what happens instead, and the exact BasicMaker error message and line number, if one is shown.
To investigate this properly, please attach a small sample document showing the relevant headings and body text, and confirm whether the macro in your first post is the version you are currently using. Please also describe the result you expect, what happens instead, and the exact BasicMaker error message and line number, if one is shown.
