Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fnWhichComponent(oDoc) as string
- if HasUnoInterfaces(oDoc, "com.sun.star.lang.XServiceInfo") then
- if oDoc.supportsService ("com.sun.star.text.GenericTextDocument") then
- fnWhichComponent = "Text"
- elseif oDoc.supportsService("com.sun.star.sheet.SpreadsheetDocument") then
- fnWhichComponent = "Spreadsheet"
- elseif oDoc.supportsService("com.sun.star.presentation.PresentationDocument") then
- fnWhichComponent = "Presentation"
- elseif oDoc.supportsService("com.sun.star.drawing.GenericDrawingDocument") then
- fnWhichComponent = "Drawing"
- else
- fnWhichComponent = "Oops current document something else"
- end if
- else
- fnWhichComponent = "Not a document"
- end if
- End function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement