| 
			 	
Prev: Is possible to save a .pdf file to Office live with code? 
		Next: A macro to bold first row in word tables 	
		 From: Greg Maxey on 20 Jan 2010 22:29 Add it and name it with code then show and hide as you wish: Sub ScratchMaco() Dim oTB As Shape With ActiveDocument.Sections(1) Set oTB = .Headers(wdHeaderFooterPrimary). _ Shapes.AddTextbox(Orientation:=msoTextOrientationHorizontal, _ Left:=50, Top:=50, Width:=100, Height:=50, _ Anchor:=.Headers(wdHeaderFooterPrimary).Range) End With oTB.Name = "MyTBToHideOrShowAtWill" End Sub Sub ScratchMaco2() ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary). _ Shapes("MyTBToHideOrShowAtWill").Visible = msoFalse End Sub Sub ScratchMaco3() ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary). _ Shapes("MyTBToHideOrShowAtWill").Visible = msoTrue End Sub Robin wrote: > Greg I think we are looking at it from two different aspects. The > text box is inserted into a header via a macro. I have no way of > actually selecting this text box to give it a name - it's inserted by > the maco but the text box is a via building block itself. It's as if > I am in a catch 22 situation. > > Robin 	
		 From: Robin on 22 Jan 2010 04:29 		OK Greg, that works. Now I have added a table into the text box and included the text box (with its table) into the text Box Gallery as a Building Block. I need to use a text box here because the table must "float" on the page. When the building block is applied the text box doesn't have any name that I specify, because I'm no longer creating it, and doing a gweneric text box hide will also hide those text boxes that should not be hidden, so I'm in a bit of a bind here ... :-( thanks Robin 
		 First
 | 
Prev
 | 
 
		Pages: 1 2 Prev: Is possible to save a .pdf file to Office live with code? Next: A macro to bold first row in word tables  |