Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-12-2019, 06:08 AM
Ulodesk Ulodesk is offline Macro not running Windows 7 64bit Macro not running Office 2013
Word 2013 Expert Cert
Macro not running
 
Join Date: Sep 2009
Location: Virginia
Posts: 866
Ulodesk is on a distinguished road
Default Macro not running

At work last week, a proposal document of 120-plus pages developed a problem during a computer freeze. When the computer was rebooted and the document reopened, all of the text bullets had been changed to the table bullet style, and each group of bulleted items had been placed in a frame.



I found the macro below, posted in 2017 on the web, and tried to use it, selecting from just above the first set of bullets to the end of the document and running the macro. It only removed the first frame. Today, trying again, I find that the document gets busy for perhaps five seconds and then abruptly closes with no change.

Since I’m not a coder, I don’t really read VBA, but this looks pretty straight-forward to me. Is there anything wrong with the macro (I’m running Office 365 on a corporate network), is the problem perhaps a network security issue preventing its execution, or might there be some other reason it would not work on this document? The only frames are those added around the bullets. There are tables and text boxes but no other frames.

Thanks.

Code:
Sub RemoveAllFramesInDoc()
  Dim objFrame As Frame
  Dim nFrame As Long
 
  Application.ScreenUpdating = False
 
  nFrame = ActiveDocument.Frames.Count
 
  For Each objFrame In ActiveDocument.Frames
    objFrame.Delete
  Next objFrame
  MsgBox ("All " & nFrame & " frames in this document have been removed!")
 
  Application.ScreenUpdating = True
End Sub
Reply With Quote
  #2  
Old 08-12-2019, 04:14 PM
Guessed's Avatar
Guessed Guessed is offline Macro not running Windows 10 Macro not running Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Sounds like the frame is coming from the style attributes.

Try modifying the style and go to Format > Frame... > Remove Frame
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 08-13-2019, 12:46 PM
Ulodesk Ulodesk is offline Macro not running Windows 7 64bit Macro not running Office 2013
Word 2013 Expert Cert
Macro not running
 
Join Date: Sep 2009
Location: Virginia
Posts: 866
Ulodesk is on a distinguished road
Default Embarrassed

Thank you very much, though I must say I am embarrassed that I didn't think to try it myself. I had reimported the style from the (custom) template and found that it had no effect. It was such an unusual change (the first time I have seen this particular glitch in more than a dozen years of proposal DTP) that I was thrown by it. I could have saved myself an hour. I certainly will not forget this lesson.

Thanks again.
Reply With Quote
Reply

Tags
delete all frames

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running Macro in Multiple word files min257 Word VBA 3 02-11-2019 09:54 PM
Cursor not showing up when running footnote macro brent chadwick Word VBA 2 04-09-2018 05:42 PM
Macro not running Allow User to Input Title When Running Attachment Macro rdross51 Word VBA 11 02-27-2015 05:52 AM
issue in running macro in mac expert4knowledge Word VBA 5 08-13-2014 02:33 PM
Macro not running Running a Macro in a protected form yessmarie Word VBA 1 05-25-2012 12:04 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:10 AM.


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