Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-15-2025, 09:14 AM
grumblid grumblid is offline Can anyone convert Word macros into LibreOffice ones? Windows 10 Can anyone convert Word macros into LibreOffice ones? Office 2003
Novice
Can anyone convert Word macros into LibreOffice ones?
 
Join Date: Jul 2016
Posts: 28
grumblid is on a distinguished road
Question Can anyone convert Word macros into LibreOffice ones?

So years ago I was helped by three legends on this forum:
@Charles Kenyon
@Guessed
@gmayor

They helped me by making macros that I had (and still have) no idea how to make, and I am grateful for them and all the time those macros have saved me in my creative writing projects. Well, now I’m in a similar situation as before.

While I don’t want to part ways with my beloved Word 2003, I know I can't keep using it forever. So I have to switch over to something more future-proof, and I've chosen LibreOffice. The problem is the Word macros won’t work on LO because they have different coding languages. I actually posted in the LibreOffice forums about it, but I figured I’d ask here too just in case someone can help here before someone can help over there.

My question is "Are there any LibreOffice macro experts in the house?"
If not, that’s okay. I’m literally on a Word forum, which has nothing to do with LibreOffice so that's my own dang fault.

If the answer is yes, I have another question for ya: Are you badass enough to convert these Word macros into LO ones??


(Because I can’t. I have no idea what I’m doing over here, haha.)

So here is the first Word macro, which makes so you can search a keyword and it’ll send all paragraphs containing those keywords to a new document that opens up:

Code:
Sub TheNewMagicTimeSaver()
  Dim oDoc As Document
  Dim oRng As Range
  Dim strKeyWord As String
  strKeyWord = InputBox("What are you looking for?")
  If strKeyWord = "" Then GoTo lbl_Exit
  Set oRng = ActiveDocument.Range
  Set oDoc = Documents.Add
  With oRng.Find
    Do While .Execute(FindText:=strKeyWord, MatchCase:=False, MatchWholeWord:=True)
      oDoc.Range.InsertAfter oRng.Paragraphs(1).Range.FormattedText
      oDoc.Range.InsertParagraphAfter
      oRng.Paragraphs(1).Range.Delete
      oRng.Collapse 0
    Loop
  End With
  oDoc.Range.ParagraphFormat.SpaceBefore = 0
  oDoc.Range.ParagraphFormat.SpaceAfter = 0
lbl_Exit:
  Exit Sub
End Sub
And here is the second Word macro, which takes all paragraphs and automatically arranges them from biggest to smallest.

Code:
Sub SortParasBySize()
  Dim aRng As Range, aTable As Table, aRow As Row
  ActiveWindow.View = wdNormalView
  With ActiveDocument.Range.Find  'Do Find and Replace for separators
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "^p"
    .Replacement.Text = "zx"
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    .Execute Replace:=wdReplaceAll
    .Text = "zxzx"
    .Replacement.Text = "^p"
    .Execute Replace:=wdReplaceAll
    ActiveDocument.Range.ConvertToTable Separator:=wdSeparateByParagraphs, NumColumns:=1
    .Text = "zx"
    .Replacement.Text = "^p"
    .Execute Replace:=wdReplaceAll
  End With
  Set aTable = ActiveDocument.Tables(1)
  aTable.Columns.Add BeforeColumn:=aTable.Columns(1)
  For Each aRow In aTable.Rows
    aRow.Cells(1).Range.Text = Len(aRow.Cells(2).Range.Text)
  Next aRow
  aTable.Rows.Add BeforeRow:=aTable.Rows(1)
  aTable.SortDescending
  aTable.Columns(1).Delete
  aTable.Columns.Add    'insert empty column to reinstate extra paras between sections
  aTable.Rows(1).Delete
  aTable.ConvertToText Separator:=wdSeparateByParagraphs
End Sub
Thank you for any help, and I apologize for still not knowing how this stuff works. I am but a simple man.

Last edited by grumblid; 11-16-2025 at 04:14 AM.
Reply With Quote
  #2  
Old 11-15-2025, 09:44 AM
Charles Kenyon Charles Kenyon is offline Can anyone convert Word macros into LibreOffice ones? Windows 11 Can anyone convert Word macros into LibreOffice ones? Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,602
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

I know nothing about LibreOffice macros but would be amazed if there is any way to "convert" Word vba. The programs have different structures and methods.


I don't know about "future-proofing." Libre Office also changes.
Most macros that work in Word 2003 work in the latest desktop versions of Word. I still use some that were written in 1997 for Word 97.
And, yes, as you asked before, Word 2003 will run in Windows 11.
Reply With Quote
  #3  
Old 11-15-2025, 10:28 AM
grumblid grumblid is offline Can anyone convert Word macros into LibreOffice ones? Windows 10 Can anyone convert Word macros into LibreOffice ones? Office 2003
Novice
Can anyone convert Word macros into LibreOffice ones?
 
Join Date: Jul 2016
Posts: 28
grumblid is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
I know nothing about LibreOffice macros but would be amazed if there is any way to "convert" Word vba. The programs have different structures and methods.


I don't know about "future-proofing." Libre Office also changes.
Most macros that work in Word 2003 work in the latest desktop versions of Word. I still use some that were written in 1997 for Word 97.
And, yes, as you asked before, Word 2003 will run in Windows 11.
Hey Charles!

I know, and part of me is still conflicted. I guess my assumption is 'Just bite the bullet and get the new thing that's free' because that's both 'at less risk of getting too old one day' and 'not having to blow $150 on the latest Word.'

Can I ask you your honest opinion on two things?

1.) My new computer (which has Windows 11, I'm on my old Windows 10 laptop right now) doesn't have a disc drive. Should I just get a USB disc drive, install 2003 and keep rolling with it without a care in the world? Am I being paranoid thinking bad things will happen running old stuff in a new tech world?

2.) Should I just get the latest Word? I heard some folks don't like it compared to how Word used to be. And some people on the LibreOffice side say part of the reason for making it the way it is, is to scratch the itches of a lot of old-school Word users who miss how Word used to be. I think that's me, honestly. The layout kinda looks like '03.

I think I overthink things, Charles. Maybe you can relate, I dunno haha
Reply With Quote
  #4  
Old 11-15-2025, 10:53 AM
Charles Kenyon Charles Kenyon is offline Can anyone convert Word macros into LibreOffice ones? Windows 11 Can anyone convert Word macros into LibreOffice ones? Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,602
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Latest Word: I had a hard time adjusting to the new Ribbon interface in Word. I got Word 2007 and then uninstalled it because it was not a good product. Word 2010 was better and I've gotten used to the new interface. I think for most purposes, 2010 is the best version of Word. I am currently using 365 which keeps changing. (Yes, to me that is annoying.) For me, Content Controls are the strongest feature of the Ribbon version.

Word 2003 is a perfectly good program. The binary file format is a bit more prone to trouble than the ribbon version .dotx files. If Word 2003 is doing what you want, stick with it.

USB DVD Drive: Yes. Get one. Even if not for this. Lots of stuff on DVDs and I borrow movies from the public library sometimes. These drives are not expensive, especially when compared to a DVD/Blueray player.
Reply With Quote
  #5  
Old 11-15-2025, 11:23 AM
grumblid grumblid is offline Can anyone convert Word macros into LibreOffice ones? Windows 10 Can anyone convert Word macros into LibreOffice ones? Office 2003
Novice
Can anyone convert Word macros into LibreOffice ones?
 
Join Date: Jul 2016
Posts: 28
grumblid is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
Latest Word: I had a hard time adjusting to the new Ribbon interface in Word. I got Word 2007 and then uninstalled it because it was not a good product. Word 2010 was better and I've gotten used to the new interface. I think for most purposes, 2010 is the best version of Word. I am currently using 365 which keeps changing. (Yes, to me that is annoying.) For me, Content Controls are the strongest feature of the Ribbon version.

Word 2003 is a perfectly good program. The binary file format is a bit more prone to trouble than the ribbon version .dotx files. If Word 2003 is doing what you want, stick with it.

USB DVD Drive: Yes. Get one. Even if not for this. Lots of stuff on DVDs and I borrow movies from the public library sometimes. These drives are not expensive, especially when compared to a DVD/Blueray player.
Yeah man I hate when things keep changing! Well sir I think you've convinced me. I thought about it and I think what I'll do is install 2003 on my Windows 11 computer, but just in case I'll also make LibreOffice backups of all my stuff just in case. No harm in having both on my tool belt!

I'll have one foot in the tried-and-true, and the other one's toe dipped in the new and unfamiliar! At the core of it all, I just care about not losing all my work over some technical stuff I don't understand. God forbid, man. I don't even want to imagine it.

Thank you for the advice and for taking the time to help me out again, Charles. You da man!
Reply With Quote
Reply

Tags
libre office, macro, word 2003



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can anyone convert Word macros into LibreOffice ones? Make Word look like LibreOffice? wrod Word 2 01-17-2023 09:12 AM
Word Refuses to Allow Macros, even when All Macros Enabled devlon Word VBA 3 10-04-2022 02:15 PM
Security warning bar for macros, without any macros ACA Word 1 10-04-2020 11:32 AM
Can anyone convert Word macros into LibreOffice ones? How to automatically enable the macros upon opening a file with macros? laurieli Office 7 01-17-2016 08:56 AM
Can anyone convert Word macros into LibreOffice ones? Macros to convert text to Table josia Word VBA 3 08-28-2015 09:11 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:56 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft