![]() |
|
#1
|
||||
|
||||
![]()
Hi verbster,
The document you referred to has a single table with cells containing Picture and Rich Text Content Controls, but it has no facility for adding a new page full of these. Assuming your document is constructed with a table containing rows for the Picture and Rich Text Content Controls, the following macro will generate a new pair of rows with these same controls. You'll probably need to redefine the row sizes to suit your needs. Note that the code uses both the CentimetersToPoints and InchesToPoints conversions - you can use either (or neither). Code:
Sub Demo() Dim ocel As Cell With ActiveDocument.Tables(1) If MsgBox("Add a new row?", vbYesNo, "Picture Manager") = vbYes Then .Range.Rows.Add .Rows.Last.Height = CentimetersToPoints(5.75) For Each ocel In .Rows.Last.Cells ocel.Range.ContentControls.Add (wdContentControlPicture) Next .Range.Rows.Add .Rows.Last.Height = InchesToPoints(0.25) For Each ocel In .Rows.Last.Cells With ocel.Range.ContentControls .Add wdContentControlRichText With .Item(1) .Tag = "Photo Caption" .PlaceholderText = "Type image caption here." End With End With Next End If End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]()
Yikes! Thanks for your help, but it's way beyond me. For some reason, I thought this was much easier . . . just a mattter of controls and Quick parts. I had no idea it involved code, which I know nothing about.
Did the person who made the photo contact sheet in the link I included use similar code? Is that how she made it possible to create a new photo contact page by clicking "New Contact Page" under Quick Parts? |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Building blocks in 2007 | derohanes | Office | 6 | 03-05-2011 01:31 PM |
![]() |
designer | PowerPoint | 1 | 01-03-2011 07:11 AM |
Pagination/Building Blocks problem | ijblack | Word | 0 | 12-23-2010 06:06 PM |
Word 2007 Building Blocks - difficult to update... | Ian Hunneybell | Word | 0 | 10-19-2009 06:27 AM |
Can't Download Controls | BillTheAdmin | Project | 2 | 12-05-2005 10:20 AM |