![]() |
|
#1
|
|||
|
|||
|
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
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
Last edited by grumblid; 11-16-2025 at 04:14 AM. |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
Quote:
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 |
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||
|
|||
|
Quote:
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! |
|
| Tags |
| libre office, macro, word 2003 |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
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 |
How to automatically enable the macros upon opening a file with macros?
|
laurieli | Office | 7 | 01-17-2016 08:56 AM |
Macros to convert text to Table
|
josia | Word VBA | 3 | 08-28-2015 09:11 PM |