Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2007

Tip: Looking for answers? Try searching our database.

Rotating a logo in header

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lars - 23 Oct 2007 12:33 GMT
Hello,

I am developing a template (Report.dot) in MS Word XP. This template
contains a macro that inserts a new page, oriented landscape. The contents of
the header and footer on this page must be rotated and re-positioned on the
right and left edge of the page (using ranges and frames) so that when the
final document is printed and assembled, all headers and footers are
consistent.

My problem is when I try to select and rotate the logos (jpeg images), I get
the following runtime error : "-2147024891 This member cannot be accessed at
this time".

The code I am using is as follows:

   Dim rngHeadr As Range
   Dim shpLogo As Shape

   With ActiveDocument.Sections(intSectionID)
       Set rngHeadr = .Headers(wdHeaderFooterPrimary).Range
   End With

   For Each shpLogo In rngHeadr.ShapeRange
       shpLogo.Select  ' <- Error occurs here
       Selection.ShapeRange.IncrementRotation 90#
   Next

Can anyone give me a work-around ? I will be very grateful !

Signature

Lars

Lene Fredborg - 23 Oct 2007 22:12 GMT
You cannot select anything in a header unless the selection is already in the
header. However, you do not need to select anything (and should not). Just
use the range object.

If you replace the following 2 code lines:

shpLogo.Select
Selection.ShapeRange.IncrementRotation 90#

with this line:

shpLogo.IncrementRotation 90#

your logo should be rotated without being selected.

Signature

Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word

> Hello,
>
[quoted text clipped - 24 lines]
>
> Can anyone give me a work-around ? I will be very grateful !
Lars - 24 Oct 2007 09:37 GMT
Hello Lene,

It works !!

Many thanks for your help. Your solution is so simple. Now that I see how it
works, I guess I was so bogged down with the different elements of ranges and
shapes that I could not see the forest, because all the trees blocked my view.

Many thanks again :)
Signature

Lars

> You cannot select anything in a header unless the selection is already in the
> header. However, you do not need to select anything (and should not). Just
[quoted text clipped - 39 lines]
> >
> > Can anyone give me a work-around ? I will be very grateful !

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.