Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 04-29-2011, 03:27 PM
macropod's Avatar
macropod macropod is online now Run a Macro in Word 2010 Windows 7 32bit Run a Macro in Word 2010 Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,527
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

Hi Joyce,

There's nothing in the code you posted that has anything to do with printing, per se. It's all about inserting one or two logos into the document header. If I've understood that code correctly, it could be simplified to:
Code:
Sub FormatTheFile()
Dim DocLogo As Document, DocMain As Document
Set DocMain = ActiveDocument
Set DocLogo = Documents.Open(FileName:=\\Lion\D$\CLIENTS\Authorization\LogoFile.doc, AddToRecentFiles:=False)
FileName$ = GetFileType$()
Select Case FileName$
  Case "IPWSM", "IPWSP", "IOPWSM"
    DocLogo.Shapes("Picture 5").Copy
    With DocMain.Sections(1).Headers(wdHeaderFooterPrimary).Range
      .Collapse wdCollapseStart
      .Paste
    End With
End Select
DocLogo.Shapes("Picture 6").Copy
With DocMain.Sections(1).Headers(wdHeaderFooterPrimary).Range
  .Collapse wdCollapseEnd
  .Paste
End With
DocLogo.Close SaveChanges:=False
FileName$ = GetFileType$()
Select Case FileName$
  Case "OICPIA", "OICPOA"
    Call OICPIA
  Case "IPSDP", "OPINTM", "IOPWSM", "IPHWP", "IOPWSPM", "IOPHEM", "IOPHEPM", "IOPHWPM", "IOPHWM"
    Selection.EndKey Unit:=wdStory
  Case Else
    'TEMP$ = MsgBox(FileName$ + ": UNKNOWN TYPE.", vbOKOnly, "Error")
End Select
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run a Macro in Word 2010 Macro to print "Current Page" in Word 2010 Jshopping Word VBA 10 06-08-2012 01:15 AM
Macro in word khalfenadeem Word 1 04-11-2011 04:35 PM
Run a Macro in Word 2010 Help with Word macro please Philcraig69 Word VBA 2 01-21-2011 04:19 PM
Word 2003 macro to Word 2007 to 2010 to... maruapo Word VBA 0 06-04-2010 03:43 PM
Word macro weezypenguin Word 0 02-25-2010 01:25 PM

Other Forums: Access Forums

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