Message 1 of 2
AttachExternalReference

Not applicable
01-15-2007
09:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Howdy everyone!
Wanted to drop somethin' by you all.. see if anyone had an idea for a better (faster) implementation. I am inserting xref title-blocks into several tabs.. it is particularly slow because the app has to activate each tab in order to add the xref. So I thought "hey! what if I just dropped them into each layout from the block collection! Then I wouldn't have to activate the tab, thus increasing speed significantly!"
The problem is... well, it doesn't work. It will only add the xref to an active layout, even if I call the attachexternalreference function from a particular inactive layout object.
Any ideas? Suggestions?
Original Working Code:
For Each layout In doc.layouts
If layout.Name Like "11X17*" Then
doc.SetVariable "CTAB", layout.Name 'Activate tab
Set xrTB = doc.PaperSpace.AttachExternalReference(tbFile, _
tb11X17, insertPoint, 1, 1, 1, 0, False)
End If
Next layout
New, not working code:
For i = 0 To doc.Blocks.count - 1
If doc.Blocks.Item(i).IsLayout Then
If doc.Blocks.Item(i).layout.Name Like "11X17*" Then
Set xrTB = doc.Blocks.Item(i).AttachExternalReference(tbFile, _
tb11X17, insertPoint, 1, 1, 1, 0, False) 'Insert Tb
End If
End If
Next i
Wanted to drop somethin' by you all.. see if anyone had an idea for a better (faster) implementation. I am inserting xref title-blocks into several tabs.. it is particularly slow because the app has to activate each tab in order to add the xref. So I thought "hey! what if I just dropped them into each layout from the block collection! Then I wouldn't have to activate the tab, thus increasing speed significantly!"
The problem is... well, it doesn't work. It will only add the xref to an active layout, even if I call the attachexternalreference function from a particular inactive layout object.
Any ideas? Suggestions?
Original Working Code:
For Each layout In doc.layouts
If layout.Name Like "11X17*" Then
doc.SetVariable "CTAB", layout.Name 'Activate tab
Set xrTB = doc.PaperSpace.AttachExternalReference(tbFile, _
tb11X17, insertPoint, 1, 1, 1, 0, False)
End If
Next layout
New, not working code:
For i = 0 To doc.Blocks.count - 1
If doc.Blocks.Item(i).IsLayout Then
If doc.Blocks.Item(i).layout.Name Like "11X17*" Then
Set xrTB = doc.Blocks.Item(i).AttachExternalReference(tbFile, _
tb11X17, insertPoint, 1, 1, 1, 0, False) 'Insert Tb
End If
End If
Next i