G
Giuliano
Hi,
I have some problems that I'm not able to solve.
1) I have a doc and I need to add some pages to it. In each page I want to
add a shape (rectangle). Here the code I use
Set rangeSection = ThisDocument.Sections(2).Range
rangeSection.EndOf wdSection, wdMove
[cut]
For l = 1 To iMissingPages
rangeSection.EndOf wdSection, wdMove
rangeSection.InsertBreak (wdPageBreak)
rangeSection.EndOf wdSection, wdMove
MsgBox rangeSection.Information(wdActiveEndAdjustedPageNumber)
Set rcRect = ThisDocument.Shapes.AddShape(msoShapeRectangle, 0,
0, 10, 10, rangeSection)
[cut]
this code is ok (it does what I want) but if I remove the msgbox line it
doesn't. Why ?
2) now I need to change the trasparency of the shape but I can't find the
property/method to do that. I've found "....fill.trasparency" but I need the
(right click)->shapes->color and lines>color -> no fill (I don't know if
this is translated correctly) where is it ?
3) finally I need to change the size to cover the whole page (the document
is 2 pages per sheet)....
rcRect.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
rcRect.RelativeVerticalPosition = wdRelativeVerticalPositionPage
sBordo = MillimetersToPoints(1)
rcRect.Left = (ThisDocument.PageSetup.LeftMargin - sBordo)
rcRect.Top = (ThisDocument.PageSetup.TopMargin - sBordo)
rcRect.Width = (ThisDocument.PageSetup.PageWidth -
ThisDocument.PageSetup.LeftMargin - ThisDocument.PageSetup.RightMargin +
(sBordo * 2))
rcRect.Height = (ThisDocument.PageSetup.PageHeight -
ThisDocument.PageSetup.TopMargin - ThisDocument.PageSetup.BottomMargin +
(sBordo * 2))
but it seems that the width is the full page (not divided by 2 as it
should be).
The strange thing is that if this code is executed inside a
macro ->macro->run ... it's ok, but if this is executed by a form the
problem arise
I'm sorry for the bad translation but I hope to be clear
Thanks
Giuliano
I have some problems that I'm not able to solve.
1) I have a doc and I need to add some pages to it. In each page I want to
add a shape (rectangle). Here the code I use
Set rangeSection = ThisDocument.Sections(2).Range
rangeSection.EndOf wdSection, wdMove
[cut]
For l = 1 To iMissingPages
rangeSection.EndOf wdSection, wdMove
rangeSection.InsertBreak (wdPageBreak)
rangeSection.EndOf wdSection, wdMove
MsgBox rangeSection.Information(wdActiveEndAdjustedPageNumber)
Set rcRect = ThisDocument.Shapes.AddShape(msoShapeRectangle, 0,
0, 10, 10, rangeSection)
[cut]
this code is ok (it does what I want) but if I remove the msgbox line it
doesn't. Why ?
2) now I need to change the trasparency of the shape but I can't find the
property/method to do that. I've found "....fill.trasparency" but I need the
(right click)->shapes->color and lines>color -> no fill (I don't know if
this is translated correctly) where is it ?
3) finally I need to change the size to cover the whole page (the document
is 2 pages per sheet)....
rcRect.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
rcRect.RelativeVerticalPosition = wdRelativeVerticalPositionPage
sBordo = MillimetersToPoints(1)
rcRect.Left = (ThisDocument.PageSetup.LeftMargin - sBordo)
rcRect.Top = (ThisDocument.PageSetup.TopMargin - sBordo)
rcRect.Width = (ThisDocument.PageSetup.PageWidth -
ThisDocument.PageSetup.LeftMargin - ThisDocument.PageSetup.RightMargin +
(sBordo * 2))
rcRect.Height = (ThisDocument.PageSetup.PageHeight -
ThisDocument.PageSetup.TopMargin - ThisDocument.PageSetup.BottomMargin +
(sBordo * 2))
but it seems that the width is the full page (not divided by 2 as it
should be).
The strange thing is that if this code is executed inside a
macro ->macro->run ... it's ok, but if this is executed by a form the
problem arise
I'm sorry for the bad translation but I hope to be clear
Thanks
Giuliano