06-30-2017
02:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
06-30-2017
02:30 AM
@Jef_E i had the same issues, and i actually recreated the manual labour in code
I use this tool a lot to avoid the workaround
Sub ReplaceView() Dim oDoc, oDocTemp As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Set oDocTemp = ThisApplication.Documents.Add(kDrawingDocumentObject) Dim oDrawingView, oDrawingViewTemp As DrawingView Set oDrawingView = oDoc.SelectSet.Item(1) Dim strDrawingViewName As String strDrawingViewName = oDrawingView.Name Call oDrawingView.CopyTo(oDocTemp.ActiveSheet) oDrawingView.Delete oDocTemp.Activate Set oDrawingViewTemp = oDocTemp.ActiveSheet.DrawingViews(1) Dim fd As FileDialog Call ThisApplication.CreateFileDialog(fd) Dim strFileName As String fd.ShowOpen strFileName = fd.FileName Call oDrawingViewTemp.ReferencedDocumentDescriptor.ReferencedFileDescriptor.ReplaceReference(strFileName) oDocTemp.Update2 Call oDrawingViewTemp.CopyTo(oDoc.ActiveSheet) Call oDocTemp.Close(True) Call oDoc.Activate oDoc.Update2 End Sub
If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
please feel free to "kudos"