
Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Thank you very very much,merci beaucoup
however,now i have done as you suggested,i realize what i want to do is not
possible that way,my bad
i'll try to explain what i want to do
i have this word document, that has a header and a footer, this header and
footer has to appear on every page.
that i can do.
in the top of the header,one can put any kind of text over the entire width
of the header
under that text,one can put any kind of text but only on the left half of
the header
next to that text,on the right half of the header,i need some kind of
textarea that i can fill in with vba code
that textarea has to be positioned exactly,it can not change position,and it
has to be multiple lines
but whatever text i put in it with code,its position,left,top,width should
not change,even if i put in more text then it can hold
(this textarea is in fact an adres that has to be aligned with a 'window' in
an enveloppe)
hope you can help me
please do not reply in french,as my english,bad as it is,is stil far better
than my french
merci beaucoup beaucoup beaucoup
> zfox was telling us:
> zfox nous racontait que :
[quoted text clipped - 37 lines]
> jmarcilREMOVE@CAPSsympatico.caTHISTOO
> Word MVP site: http://www.word.mvps.org
Jean-Guy Marcil - 17 Apr 2007 19:45 GMT
PC was telling us:
PC nous racontait que :
> Thank you very very much,merci beaucoup
> however,now i have done as you suggested,i realize what i want to do
[quoted text clipped - 19 lines]
> better than my french
> merci beaucoup beaucoup beaucoup
Insert a textbox in your header. Set its Line to "No Line". Make it just a
little bigger than what you need.
Inside the textbox, create a one-row/one-column table.Make it exactly the
size you need it. Make sure that the row height is set to "Exactly" the
height you need and uncheck the "Automatically resize to fit content"
options from the Options button on the Table tab of the Table Properties
dialog.
Finally, in your code, use this to refer to that table (Assuming, again,
that you are using the primary header of Section 1, and that this header
contains only one textbox which contains only one table).
Dim tblHeader As Table
Set tblHeader = ActiveDocument.Sections(1) _
.Headers(wdHeaderFooterPrimary).Range _
.ShapeRange(1).TextFrame.TextRange.Tables(1)
With tblHeader
.Cell(1, 1).Range.Text = "My text"
End With

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
PC - 18 Apr 2007 22:24 GMT
Jean-Guy
i tried your last suggestion, and it works,merci beacoup beacoup beacoup
then after studying your code i tried:
Sub FactuurAdres()
Dim FactuurAdres As String
FactuurAdres = "Adresline1" & vbCrLf & "Adresline2" & vbCrLf &
"Adresline3"
ActiveDocument.Sections(1) _
.Headers(wdHeaderFooterPrimary).Range _
.ShapeRange(1).TextFrame.TextRange.Text = FactuurAdres
End Sub
and it worked to,hurray
then i added some wordart in the header...it stopped working
i changed '.ShapeRange(1)' to '.ShapeRange(2)'...and it worked again
so i tried out with more than 1 textbox and more than 1 wordart
i found that '.ShapeRange(1)' is the object that is highest placed in the
header,'.ShapeRange(2)' the next highest,etc...
this was kind of a problem
so i remembered i had seen on your webside something "How to find and
replace text anywhere in a document"
so i tried that...and it worked...kind of
i typed <FactuurAdres> in some textboxes in several places in a document
and tried to find <FactuurAdres> and replace it with the string "Adresline1"
& vbCrLf & "Adresline2" & vbCrLf & "Adresline3"
and it worked...kind of
<FactuurAdres> was everywhere replaced with 'Adresline1'...not exactly what
i wanted
after some tries,with everytime the same result, i placed the cursor after
Adresline1,pushed 'DEL'
and lo, Adresline2 appeared, did the same after Adresline2 and Adresline3
appeared
so i type <FactuurAdres> in a textbox and hit 'ENTER'
and after the the find and replace it was replaced with:
Adresline1
Adresline2
Adresline3
just what i wanted
i stil had to change the string "Adresline1" & vbCrLf & "Adresline2" &
vbCrLf & "Adresline3"
with
the string "Adresline1" & vbCr & "Adresline2" & vbCr & "Adresline3"
and now it works exactly the way i want,all thanks to you
thank you very very very much
> PC was telling us:
> PC nous racontait que :
[quoted text clipped - 52 lines]
> jmarcilREMOVE@CAPSsympatico.caTHISTOO
> Word MVP site: http://www.word.mvps.org
Jean-Guy Marcil - 19 Apr 2007 02:00 GMT
PC was telling us:
PC nous racontait que :
> Jean-Guy
> i tried your last suggestion, and it works,merci beacoup beacoup
[quoted text clipped - 41 lines]
> and now it works exactly the way i want,all thanks to you
> thank you very very very much
Not sure I follow all that, but I'm glad to see you sorted it out on your
own.
By the way, it is not MY website...

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org