Home » Developer & Programmer » Reports & Discoverer » Can't set anchor of picture when insert into word using OLE2, AddPicture method.
Can't set anchor of picture when insert into word using OLE2, AddPicture method. [message #119169] Tue, 10 May 2005 23:53
tuanpa
Messages: 1
Registered: May 2005
Location: vietnam
Junior Member

Hi! i'm a new member, please help me!
I use OLE2 to create word object then insert into it a picture, but i can't fix position of picture in a range.
here is my code:

vh_shapes := ole2.get_obj_property(ph_doc, 'Shapes');
vh_args := ole2.create_arglist;
ole2.add_arg(vh_args, vc_file); -- FileName
ole2.add_arg(vh_args, '0'); -- LinkToFile
ole2.add_arg(vh_args, '1'); -- SaveWithDocument
ole2.add_arg(vh_args, '0'); -- left
ole2.add_arg(vh_args, '80'); -- top
ole2.add_arg(vh_args, '80'); -- Width
ole2.add_arg(vh_args, '120'); -- Height
--ole2.add_arg(vh_args, vh_range); -- Anchor
vh_photo := ole2.invoke_obj(vh_shapes, 'AddPicture',vh_args);

it is OK. But i can't set position for picture by anchor with this statement:

vh_bookmarks := ole2.get_obj_property(ph_doc,'Bookmarks');
vh_args := ole2.create_arglist;
ole2.add_arg(vh_args, 'pic_postion');
vh_bookmark := ole2.invoke_obj(vh_bookmarks, 'Item',vh_args);
ole2.invoke(vh_bookmark, 'Select');
vh_range := ole2.get_obj_property(vh_bookmark, 'Range');
Please help me!
thanks.
Previous Topic: Reports 6i execution on Unix environment
Next Topic: Print number of pages, specified in a text file
Goto Forum:
  


Current Time: Mon Nov 04 15:04:58 CST 2024