Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-13-2024, 02:01 AM
Alyb Alyb is offline Word for Mac doesn't quit Mac OS X Word for Mac doesn't quit Office 2016 for Mac
Novice
Word for Mac doesn't quit
 
Join Date: Jan 2023
Posts: 8
Alyb is on a distinguished road
Default Word for Mac doesn't quit

I have this macro to fill a form (an RTF document) with {FORMTEXT} fields. I found no way to access these fields directly, so this is what I came up with:

Code:
Sub FillForm()
    Selection.Find.ClearFormatting
    With Selection.Find
        .Text = "Comments"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute
    Selection.MoveRight Unit:=wdCell
    Selection.TypeText Text:="No comment"
    Selection.MoveRight Unit:=wdCell
    Selection.EndKey Unit:=wdLine
    Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
    Selection.InsertDateTime DateTimeFormat:="MMMM dd, yyyy", InsertAsField:=False
    Selection.MoveRight Unit:=wdCell
    Selection.EndKey Unit:=wdLine
    Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
    Selection.TypeText Text:="Alyb"
    ActiveDocument.save
    Application.Quit SaveChanges:=wdDoNotSaveChanges
End Sub
The strange thing is that Word for Mac (Microsoft® Word for Mac, Version 16.91 (24111020)) doesn't quit after running the macro. How come?



And I have one other question: every time I change a macro, I have to grant Word for Mac access to the normal.dotm. Can this step be automated/prevented?

Last edited by macropod; 11-19-2024 at 12:24 AM. Reason: Added code tags
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word for Mac doesn't quit Close file or quit application ? MartinGM Excel Programming 1 09-29-2023 03:25 AM
Help Quit Working in All Office 365 Apps RetiredCHE Office 0 10-01-2019 06:56 PM
The Word userform checkbox (checked/unchecked) is not saved on the Application Quit matapagi2019 Word VBA 3 03-31-2019 02:29 AM
Word for Mac doesn't quit all of my formulas quit automatically calculating chenstrap Excel 4 03-16-2016 08:04 AM
Word Crash on Quit masomenos Word 2 11-09-2010 12:35 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:53 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