Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-14-2015, 08:03 AM
mhagi mhagi is offline shapes in header Windows 7 64bit shapes in header Office 2010 64bit
Novice
shapes in header
 
Join Date: Oct 2015
Posts: 8
mhagi is on a distinguished road
Default shapes in header

Hi all,
I’m fiddling around with shapes in headers.
I have 3 sections.
Sectionstart is always wdsectionnewpage.
Differentfirstpageheaderfooter is always 0 =false
Headers are not linked to previous.
Every section has 1 shape in header.
Now, when I try to count the shapes in primary header of section(1)


Activedocument.sections(1).headers(wdheaderfooterp rimary).shapes.count
I get 3 instead of 1.
Every additional section not linked to previous adds 1 to shapes.count.
Help says, shapes are counted for given section only and has example.

Where do I go wrong? I want number of shapes in defined header of defined section.

Thanks in advance
mhagi
Reply With Quote
  #2  
Old 10-15-2015, 05:32 AM
macropod's Avatar
macropod macropod is offline shapes in header Windows 7 64bit shapes in header Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
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

Try:
Code:
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.ShapeRange.Count
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-16-2015, 12:21 AM
mhagi mhagi is offline shapes in header Windows 7 64bit shapes in header Office 2010 64bit
Novice
shapes in header
 
Join Date: Oct 2015
Posts: 8
mhagi is on a distinguished road
Default shapes in header

Hi Paul,

tx again.
I'm really sorry I had to come back again.
The solution you proposed earlier worked just fine (thanks again!) - until I copied the document to another machine with default environment. The fields ( and I really should have noticed at once) came up with error on printing. I tried to nail down field update on autotext-fields , but got chicken, cause our documents have lots and lots of fields, which need to update. And if I get 1 of those wrong - probabely sky would crash down on my head.

So I decided to get back to inserting shapes.
But you probabely know how it is with users, long documents, different sections and headers. Ours tend to inserting parts of older documents regardless of sections and headers.
Therefore I have to check each section and header type, if logo-shape is already on.
And I got really miffed, when I tried out the help-example to count shapes in given header of given section and it did not work.

Oh well, life is not easy but we are lucky there are forums where nice people answer stupid questions.

Thanks again
mhagi
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to Use Styles for Shapes lostinwebspace Word 2 04-03-2015 08:04 AM
All Shapes on slide excelledsoftware PowerPoint 9 09-15-2013 04:03 AM
shapes in header Where did map shapes go? SueK PowerPoint 1 01-20-2011 04:30 AM
shapes in header Find and add new Shapes bonani PowerPoint 1 11-26-2009 06:21 PM
My Shapes some appear some don't Jean-Paul Visio 0 03-01-2006 01:38 AM

Other Forums: Access Forums

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