Bugzilla – Attachment 164008 Details for
Bug 135433
Add support for "TK" keyword for content writing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Macro to insert image page margin
InsertImageInPageMargin.bas (text/plain), 1.75 KB, created by
Regina Henschel
on 2020-08-06 15:47:57 UTC
(
hide
)
Description:
Macro to insert image page margin
Filename:
MIME Type:
Creator:
Regina Henschel
Created:
2020-08-06 15:47:57 UTC
Size:
1.75 KB
patch
obsolete
>REM ***** BASIC ***** >option explicit > >sub InsertImageInPageMargin >rem Get path to image >dim oPathsubstitution as variant >dim sUserPath as string >oPathsubstitution = createUnoService("com.sun.star.util.PathSubstitution") >sUserpath = oPathsubstitution.substituteVariables("$(user)",1) >dim sImagePath as string >rem Adapt path to your needs. Here the image is expected to be at the same >rem place as the file registrymodifications.xcu in the user folder. >sImagePath = sUserpath + "/warning.png" > >rem Insert image using dispatcher >dim oFrame as variant >dim oDispatcher as variant >oFrame = ThisComponent.CurrentController.Frame >oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper") >dim args1(3) as new com.sun.star.beans.PropertyValue >args1(0).Name = "FileName" >args1(0).Value = sImagePath >args1(1).Name = "FilterName" >args1(1).Value = "<All images>" >args1(2).Name = "AsLink" >args1(2).Value = false >args1(3).Name = "Style" >args1(3).Value = "Marginalia" >oDispatcher.executeDispatch(oFrame, ".uno:InsertGraphic", "", 0, args1()) > >rem Set image to page margin >dim oDocument as variant: oDocument = ThisComponent >dim oDrawPage as variant: oDrawPage = oDocument.DrawPage >rem After dispatcher has inserted the image, it should be selected. >dim oImage as variant: oImage = oDocument.CurrentSelection >if oImage.supportsService("com.sun.star.text.TextGraphicObject") then > oImage.TextWrap = com.sun.star.text.WrapTextMode.THROUGH > oImage.AnchorType = com.sun.star.text.TextContentAnchorType.AT_PARAGRAPH > oImage.HoriOrient = com.sun.star.text.HoriOrientation.CENTER > oImage.HoriOrientRelation = com.sun.star.text.RelOrientation.PAGE_RIGHT > rem interpret right margin as outer margin > oImage.PageToggle = true >end if >end sub > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 135433
:
163931
| 164008