Just like:
string picPath=@"..."//The full path of the psd file
illutrator.RasterItem raster=null;
try
{
for(int i=0;i<doc.RaterItems.count;i++)//doc is the AI file that has been open correctly
{
raster=doc.RasterItem[i];
if(raster.Editble&&File.Exists(picPath))
{
raster.URL=picPath;
}
}
//Save changes of the AI file
...........
}
catch(Exception)
{
....
}
No exception is thrown but the RaterItems in the AI file stay unchanged,but after the operation I tried to get the RasterItem::URL attribute again ,it return the url I set to the RasterItem::URL property.