[mso] Re: Automating Consultant business using word and excel.

  • From: "Michael Luevane" <mikel@xxxxxxxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Thu, 4 Sep 2003 10:23:14 -0700

I re-read the message and I see that my reply was a bit off the mark.

So, to apologize, I have written a macro to remove the logo graphic from a
letterhead document, print it, and restore the graphic when completed.

Enjoy!

Sub PrintToLetterhead()
'
' PrintToLetterhead Macro
' by Michael Luevane
'
' Removes a logo graphic from the header of a document.
' Note: This macro assumes that the grahic is the FIRST item in the header.
' It's not as generic as I would like, but it works.

' Feel free to modify as needed.

' Some variables to declare ahead of time:
    Dim HeightOfLogo As Double
    Dim FullPathToLogo As String
    Dim LogoFilename As String
    Dim TheLogo As String

    HeightOfLogo = 135 ' Taken from the picture's properties dialog box
    FullPathToLogo = "c:\path\to\logo\"  'Don't forget the trailing "\"
    LogoFilename = "logo_filename_any_type.jpg" 'Doesn't *have* to be JPG
    TheLogo = FullPathToLogo & LogoFilename

    Application.ScreenUpdating = False

    'Clear out the header

    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    Selection.MoveRight unit:=wdCharacter, Count:=1, Extend:=wdExtend
    Selection.Delete

    'Resize it to match the header from the logo (or whatever height you
like)

    Selection.MoveRight unit:=wdCharacter, Count:=1, Extend:=wdExtend
    With Selection.ParagraphFormat
        .SpaceBefore = HeightOfLogo
    End With

    ' Print it
    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
    Application.PrintOut

    'Now put everything back

    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader

    ' Change paragraph height...

    Selection.MoveRight unit:=wdCharacter, Count:=1, Extend:=wdExtend
    With Selection.ParagraphFormat
        .SpaceBefore = CurrentHeight
    End With

    ' Put in the logo...
    Selection.InlineShapes.AddPicture FileName:= _
        TheLogo, LinkToFile:=False, _
        SaveWithDocument:=True

    ' Close the header view
    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
    If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
        ActiveWindow.Panes(2).Close
    End If
    If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
        ActivePane.View.Type = wdOutlineView Then
        ActiveWindow.ActivePane.View.Type = wdPrintView
    End If

    Application.ScreenUpdating = True

End Sub

 /================================================\
| Michael Luevane      | Systems Administrator     |
| mikel@xxxxxxxxxxxxxx | Quantec, LLC              |
| 503-228-2992         | http://www.quantecllc.com |
 \================================================/

> -----Original Message-----
> From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx]On
> Behalf Of Dian Chapman
> Sent: Thursday, September 04, 2003 8:55 AM
> To: mso@xxxxxxxxxxxxx
> Subject: [mso] Re: Automating Consultant business using word
> and excel.
>
>
> If you LINK the image and then move it...you'll get the
> placeholder and
> there won't be anything to print...but the spacing will
> remain! <wink>
>
>
> Dian Chapman
> Technical Consultant,
> Microsoft MVP & Instructor
>
> Free Tutorials: www.mousetrax.com/techtrax
> Free Word Tips & Tricks eBook: www.mousetrax.com/books.html
> Learn VBA the easy way, thru video! www.mousetrax.com/techcourses.html
>
>
>
>
> -----Original Message-----
> From: mso-bounce@xxxxxxxxxxxxx
> [mailto:mso-bounce@xxxxxxxxxxxxx] On Behalf
> Of Katherine Driskell Felts
> Sent: Thursday, September 04, 2003 7:19 AM
> To: mso@xxxxxxxxxxxxx
> Subject: [mso] Re: Automating Consultant business using word
> and excel.
>
> Thing is, taking the logo out makes the header smaller and
> moves everything
> up into the header area.
>
> I think I'll just go with making the picture very light.
> Thanks though.
>
> Any other suggestions on the billing?  I have had a hard time
> getting the
> tables in word to do the math for me very well.  I had been
> using excel to
> track time, but then sending it to word to put on my little
> invoice thing
> always looked real bad and took too long and seemed to always
> end up needing
> to be in landscape.  Even coding the excel coding was a pain.
>
> No, I don't use QuickBooks.  I'm puting a limit on the amount
> of stuff I
> have to learn that isn't directly related to my client work,
> and accounting
> and accounting programs are on the other side of that line.  I also am
> really better off paying someone else to do my books.  But
> thanks for that.
>
>
> --
> Katherine Driskell Felts
> kdfconsulting
> Bringing resources and results together(sm) Sign Up for our email
> newsletter, KuDos Files (tm) on our website www.kdfconsulting.com
> 507-444-0204
> Toll free: 1-866-kdf-4-411
>
> *************************************************************
> You are receiving this mail because you subscribed to
> mso@xxxxxxxxxxxxx or
> MicrosoftOffice@xxxxxxxxxxxxxxxx
>
> To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
>
> To Unsubscribe from this group, send an email to
> mso-request@xxxxxxxxxxxxx
> with the word "unsubscribe" (without the quotes) in the subject line.
>
> Or, visit the group's homepage and use the dropdown menu.
> This will also
> allow you to change your email settings to digest or vacation
> (no mail).
> //www.freelists.org/webpage/mso
>
> To be able to use the files section for sharing files with
> the group, send a
> request to mso-moderators@xxxxxxxxxxxxx and you will be sent
> an invitation
> with instructions.  Once you are a member of the files group,
> you can go
> here to upload/download files:
> http://www.smartgroups.com/vault/msofiles
> *************************************************************
>
> *************************************************************
> You are receiving this mail because you subscribed to
> mso@xxxxxxxxxxxxx or MicrosoftOffice@xxxxxxxxxxxxxxxx
>
> To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
>
> To Unsubscribe from this group, send an email to
> mso-request@xxxxxxxxxxxxx with the word "unsubscribe"
> (without the quotes) in the subject line.
>
> Or, visit the group's homepage and use the dropdown menu.
> This will also allow you to change your email settings to
> digest or vacation (no mail).
> //www.freelists.org/webpage/mso
>
> To be able to use the files section for sharing files with
> the group, send a request to mso-moderators@xxxxxxxxxxxxx and
> you will be sent an invitation with instructions.  Once you
> are a member of the files group, you can go here to
> upload/download files:
> http://www.smartgroups.com/vault/msofiles
> *************************************************************
>
>

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: