Thread: [Solved] Clear document
View Single Post
 
Old 07-17-2011, 10:11 AM
Jaymond Flurrie Jaymond Flurrie is offline Windows 7 64bit Office 2010 32bit
Novice
 
Join Date: Feb 2011
Posts: 13
Jaymond Flurrie is on a distinguished road
Default

I tried that later part, just by pasting a link:

Code:
With appWD.Selection
        .MoveRight Unit:=wdCharacter, Count:=1
        .TypeText Text:="Left part of header"
        .ParagraphFormat.Alignment = wdAlignParagraphLeft
        .TypeText Text:=vbTab & vbTab & "right part of header"
        DocWD.Parent.ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
    
        strChartName = "A. header"
        shtCharts.Shapes(strChartName).Copy
        .TypeText Text:=vbTab & vbTab & vbTab & vbTab & strChartName & vbCrLf
        .Font.Bold = wdToggle
        .PasteSpecial Link:=False, DataType:=wdPasteMetafilePicture, Placement:=wdInLine, DisplayAsIcon:=False
        .InsertBreak Type:=wdPageBreak
        
        strChartName = "B. header"
        shtCharts.Shapes(strChartName).Copy
        .TypeText Text:=vbTab & vbTab & vbTab & vbTab & strChartName & vbCrLf
        .Font.Bold = wdToggle
        .PasteSpecial Link:=True, DataType:=wdPasteMetafilePicture, Placement:=wdInLine, DisplayAsIcon:=False
        .InsertBreak Type:=wdPageBreak
    End With
That first paste doesn't work, the next works fine. The error it gives is Run-time error '5342': The specified datatype is unavailable. Seems to me something is wrong with using that wdPasteMetafilePicture, but what?
Reply With Quote