I created a Multisheet drawing file.(.idw)
While the file to DWF format with WriteDataToFile, the Title Block shows wrong Sheet number.
For a 5 Sheet drawing, the output DWF files contain following Titles:
1 of 2
2 of 3
3 of 4
4 of 5
5 of 5
Whereas expected titles should be:
1 of 5
2 of 5
3 of 5
4 of 5
5 of 5
Interestingly, if I create a multisheet Drawing and Activate all sheets one by one before saving it.
The DWF files outputted show correct Titles.
Hence in the first case, I used Activate() on all sheets before writing them with WriteDataToFile. But could not get correct Titles.
Seems like a issue with WriteDataToFile()
Hi,
I maybe missed something, but it looks only Sheet has DataIO, which means you have to output them to DWF one by one. But it looks you output them in one DWF? Could you share your code?
In addition, if this is really a problem, I'd suggest you give it a try with TranslatorAddin of DWF, which maybe work as you expected.
by the way, this is the code I am using with WriteDataToFile
Sub xxx() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet Dim i As Integer i = 1 For Each oSheet In oDoc.Sheets Dim oDataIO As DataIO Set oDataIO = oSheet.DataIO Dim Formats() As String Dim StorageTypes() As StorageTypeEnum oDataIO.GetOutputFormats Formats, StorageTypes Dim FullFileName As String FullFileName = oDoc.FullFileName Dim NewFileName As String Dim pos As Integer 'set the file name pos = InStrRev(FullFileName, ".") NewFileName = Left(FullFileName, pos - 1) NewFileName = NewFileName & "_" & i & ".dwf" oDataIO.WriteDataToFile "DWF", NewFileName i = i + 1 Next End Sub