Hi All,
I have been searching 'word automation' for adding picture in word document
--here is the sample code
Name DataType Subtype Length
wdApp Automation 'Microsoft Word 11.0 Object Library'.Application
wdDoc Automation 'Microsoft Word 11.0 Object Library'.Document
wdDocs Automation 'Microsoft Word 11.0 Object Library'.Documents
wdRange Automation 'Microsoft Word 11.0 Object Library'.Range
IF ISCLEAR(wdApp) THEN
CREATE(wdApp);
IF ISCLEAR(wdDoc) THEN
CREATE(wdDoc);
CLEAR(wdDoc);
CLEAR(wdRange);
IF ERASE('C:\21.DOC') THEN;
Filename1 := 'C:\2.DOt';
Filename2 := 'C:\21.DOC';
wdDoc := wdApp.Documents.Add(Filename1);
wdApp.ActiveDocument.Fields.Update;
CompanyInfo.GET;
WITH CONTACT DO BEGIN
FINDFIRST;
wdRange := wdApp.ActiveDocument.Fields.Item(1).Result;
wdRange.Text := "First Name";
wdRange := wdApp.ActiveDocument.Fields.Item(2).Result;
wdRange.Text := CONTACT.Surname;
End;
wdApp.Visible := TRUE;
wdApp.ActiveDocument.Fields.Unlink;
wdDoc.SaveAs(Filename2);
Now i need to add picture from item table in my word document. How can i do that??
Many Thanks
0
Comments
http://www.BiloBeauty.com
http://www.autismspeaks.org
CompanyInfo.CALCFIELDS(Picture);
CompanyInfo.Picture.EXPORT('C:\Pic.bmp',FALSE);
Filename := 'C:\Pic.bmp'
1. WordInlineShape := WordSelection.InlineShapes.AddPicture(theFileName);
2. WordInlineShape.Height := 141.75;
3. WordInlineShape.Width := 188.8;
Name DataType Subtype Length
WordSelection Automation 'Microsoft Word 12.0 Object Library'.Selection
WordInlineShape Automation 'Microsoft Word 12.0 Object Library'.InlineShape
I need to show this picture in particular location in word document(say right bottom side). How can i achieve that??
Thanks
Open Word -> Start Macro Recording -> Do this what Navision should do -> Stop macro recording -> View the VBA source.
now you know which "Automations" you must use and how to do it .....
Regards
I need to add picture to a bookmark in the word document. Any help??