Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 09-28-2016, 03:19 PM
macropod's Avatar
macropod macropod is offline VBA macro code to remove BMP, text and seal from documents Windows 7 64bit VBA macro code to remove BMP, text and seal from documents Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

In that case, try the following macro. It doesn't yet test the DocType$ variable (first line in your code), because I don't know what the larger context is.
Code:
Sub PrintNoHeader()
Application.ScreenUpdating = False
Dim pState As Variant, bFit As Boolean, Sctn As Section, HdFt As HeaderFooter
Const Pwd As String = ""
With ActiveDocument
  .Save
  pState = False
  If .ProtectionType <> wdNoProtection Then
    pState = .ProtectionType
    .Unprotect Pwd
  End If
  For Each Sctn In .Sections
    For Each HdFt In Sctn.Headers
      With HdFt
        If .LinkToPrevious = False Then
          .Range.Text = vbNullString
        End If
      End With
    Next
  Next
  If pState <> wdNoProtection Then .Protect Type:=pState, NoReset:=True, Password:=Pwd
  Application.Dialogs(wdDialogFilePrint).Show
  Application.DisplayAlerts = wdAlertsNone
  .Reload
  Application.DisplayAlerts = wdAlertsAll
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro code that prompts user to enter text, then does find/replace. sfvegas PowerPoint 0 01-10-2016 08:02 PM
Macro/VBA code to select ALL text in a textbox in microsoft excel and add a new row jyfuller Excel Programming 11 06-01-2015 08:49 PM
VBA macro code to remove BMP, text and seal from documents I need to convert shaded text into highlighted text on about 80 different long documents. VBA macro? AustinBrister Word VBA 8 05-28-2015 02:42 PM
VBA macro code to remove BMP, text and seal from documents VBA code for Microsoft Word macro — select text and insert footnote ndnd Word VBA 10 01-06-2015 01:47 PM
VBA macro code to remove BMP, text and seal from documents Need help on Macro 03- Find text - if text is blank then remove line simpleonline1234 Word VBA 1 02-25-2011 02:28 AM

Other Forums: Access Forums

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