#1
|
|||
|
|||
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 |
#2
|
||||
|
||||
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 |
#3
|
|||
|
|||
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. |
Tags |
delete all frames |
|
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 |
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 |
Running a Macro in a protected form | yessmarie | Word VBA | 1 | 05-25-2012 12:04 AM |