View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sierk Sierk is offline
external usenet poster
 
Posts: 6
Default Further Challenges with Footers and automatic text wrapping

Everything is working with the exception of the final result. I have the
potential for some really long file paths and names. The problem is that the
three footer elements (leftfooter, centerfooter and rightfooter) are bottom
justified. All three are used as follows:

dd/mm/yyyy page
Company Name
Very long
file path and name.xls

If all three footer elements were top justified the problem would be solved.
I have tried adding carriage returns ( chr(13) ) in the left and center
footer which works. However I cannot tell how many lines my right footer is
going to be, 2 or 3. I have tried character counting but the combination of
flexible character width and automatic wrapping on a space and a dash only
make that idea very difficult to program. Any ideas? The code I have used
thusfar for setting the footer is as follows:

vFont = "&""Times New Roman,Regular""&8"
vFile = " &F"
vCR = Chr(13)
vCoName = "CompanyName"

' Assign date to left footer variable
vLeftFooter = vFont & "&D"
' Assign page number to center footer variable
vCenterFooter = vFont & "&P"
' Assign company name, carriage return and file path to right footer
variable
vRightFooter = vFont & vCoName & vCR & vPath & vFile

ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftFooter = vLeftFooter
.CenterFooter = vCenterFooter
.RightFooter = vRightFooter
End With