Hi Campo,
A couple of options come to mind...
1> You can look at the ReportCreation.c file in \Sanmples\COM Client subfolder and edit that and change BMP to EMF, including in the Image.Export.PageDPI() method and thus use the export method to export EMF file instead of BMP and use the exported file and insert that into word similar to that example
2> Change your code as follows: I could paste the image from clipboard into the first cell of table, but looks like some follow up command is needed to resize the table cell - or perhaps that is another setting in paste - need to look up VB code details...
Note that paste can be OLE paste or metafile paste, depending on specification of paste type argument in last line.
Hope this helps.
Easwar
OriginLab
// Need to get Word VB constants for paste type - can look in visual basic editor under Word
#define wdPasteOLEObject 0
#define wdPasteMetafilePicture 3
void pasting_to_Word()
{
// Word öffnen
Object oWord, oWordDoc;
// Need to point to active page and check validity?
GraphPage gp = Project.Pages();
if( !gp ) return;
oWord = CreateObject("Word.Application");
oWord.Visible = true;
// neues Word-Dokument erstellen
string strFldPath = GetAppPath(true) + "Samples\\COM Client\\";
oWordDoc = oWord.Documents.Add(Template := strFldPath + "ReportTemplate.dot");
// Graph auswählen
string strName = gp.GetName();
out_str(strName);
BOOL bShown = gp.Show;
if (!bShown)
gp.Show = TRUE;
string strLtcmd = "clipboard " + strName;
gp.LT_execute(strLtcmd);
if (!bShown)
gp.Show = FALSE;
// Einfügen des Graphs
// Selection referes to where the cursor is located,
// and that is Word Application property, not Word Doc property
oWord.Selection.Range.PasteSpecial(DataType:=wdPasteOLEObject );
// Need to resize table cell....need to look that up...
}
Edited by - easwar on 04/24/2006 4:40:54 PM