Open the document in Microsoft® Word® and double-click the image to open the file associated with the OLE object. OleObject.TextWrapping = TextWrappingType.TopAndBottom ' Specify how text wraps around the object. OleObject.RelativeVerticalPosition = ShapeRelativeVerticalPosition.Paragraph OleObject.RelativeHorizontalPosition = ShapeRelativeHorizontalPosition.Column ' Specify the object position on the page. OleObjectType.ExcelWorksheet, DocumentImageSource.FromFile("Images\Spreadsheet.png")) Link it to an Excel worksheet.ĭim oleObject As Shape = (document.CreatePosition(1780), "D:\ExcelWorkbook.xlsx", _ Specify how text wraps around the object. Shape oleObject = (document.CreatePosition(1780), Specify the object position on the page. The OLE object is displayed in the document as an image. You can use constant fields of the OleObjectType class to specify the file type. Use the ShapeCollection.InsertOleObject method overload with the fileName parameter to create an OLE object that stores a link to a specified file. = ĭim textBoxDocument As SubDocument = ĭim cp As CharacterProperties = textBoxDocument.BeginUpdateCharacters(, 4)Ĭp.ForeColor = SubDocument textBoxDocument = ĬharacterProperties cp = textBoxDocument.BeginUpdateCharacters(, 4) Ĭp.ForeColor = ĭim myTextBox As Shape = (, New RectangleF(1.5F, 1F, 1.5F, 0.5F)) Specify the text box background color. Picture.HorizontalAlignment = ShapeHorizontalAlignment.Center Picture.VerticalAlignment = ShapeVerticalAlignment.Top Picture.HorizontalAlignment = ShapeHorizontalAlignment.Center ĭim picture As Shape = (, DocumentImageSource.FromFile("Dog.png")) Shape picture = (, DocumentImageSource.FromFile("Dog.png")) The example below inserts a picture with rounded corners. Use the Shape.PictureFormat property to access picture settings. (Color.FromArgb(&HFF, &HEE, &HAD))īorder.Color = Color.FromArgb(&H4D, &H64, &H8D)Ĭall the ShapeCollection.InsertPicture method to insert a picture into a document. (Color.FromArgb(0xFF, 0圎E, 0xAD)) īorder.Color = Color.FromArgb(0x4D, 0圆4, 0x8D) ĭim document As Document = wordProcessor.Documentĭocument.Unit = ĭim rectangle As Shape = (, ShapeGeometryPreset.Rectangle, New RectangleF(1.5F, 1F, 2F, 1.5F)) Shape rectangle = (, ShapeGeometryPreset.Rectangle, new RectangleF(1.5f, 1f, 2f, 1.5f)) I forgot to mention that all the steps I described should be in the Twiki WYSIWIG editor.Document document = wordProcessor.Document ĭocument.Unit = just force resizing (and jpeg optimization), do not provide options. If they really want to upload high-resolution images, they will have to contact us, and we will advise them not to store them on the blog anyways, but on dedicated servers with big storage, and mirrored in various countries So we only do steps 1,2 & 6, the rest is automatically done to avoid confusing users. So we configured the plugin (*) to resize the image to 1024px width max automatically with no options. What we found out is that users just upload the photos from their camera, huge 5 Megapixels or more. We added this functionality to our internal wordpress blog.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |