Home of site


Macroの杜
(OpenOffice.org/LibreOffice Basic編)

Math( 数式作成 )


**********************【 Index 】**********************

File


Document Property


Font












**********************【 Macro Code 】**********************

File

MF-1)[Math]新規Math fileの開閉(保存確認無し)

Sub oImpressOpen
	Dim Dummy()
		oDoc = StarDesktop.loadComponentFromURL("private:factory/smath", "_blank", 0, Dummy())
		oAns = Msgbox("ファイルを閉じますか?",4, "File Close確認")
		if oAns = 6 then
			oDoc.dispose
		End if
End Sub

MF-)[Math]新規Math fileの開閉(保存確認有り)

Sub oMathOpen_Save
	Dim Dummy() 
		oDoc = StarDesktop.loadComponentFromURL( "private:factory/smath", "_blank", 0, Dummy())
 		oAns = Msgbox("fileを保存しますか?",4, "File Save確認")
 		 if oAns = 6 then
 		 	oInp = InputBox("Full pathでFile nameを入力して下さい(例 : C:\temp\test.odf)","保存File nameの入力")
 		 	If NOT IsNull(oInp) then
 		 		oMName = ConvertToUrl(oInp) 
 		 		oDoc.storeAsURL(oMName, Dummy())
 		 	End If
		End If
		oAnsC = MsgBox("Fileを閉じますか?",4,"Fileの終了確認")	
 		 If oAnsC = 6 then
 		 		oDoc.dispose
 		 End If
End Sub

Document Property

MDPp-)[Math]Formula


Sub oPropInfo
	Dim oDoc
	Dim oDummy()
		On Error Goto oBad 
			oDoc = StarDesktop.loadComponentFromURL("private:factory/smath", "_blank", 0, oDummy())
				oprop = oDoc.Formula
			msgbox(oprop,0,"[ Formula ]")
			oDoc.dispose
			Exit Sub
	oBad: 
			mErr = Error
			eline = Erl
			msgbox("Line : " & eline & Chr$(10) & mErr & Chr$(10) &" : i = " & i, 0,"Error Message" )
			oDoc.dispose
End SUb

MDPp-)[Math]PrinterName


Sub oPropInfo
	Dim oDoc
	Dim oDummy()
		On Error Goto oBad 
			oDoc = StarDesktop.loadComponentFromURL("private:factory/smath", "_blank", 0, oDummy())
				oprop = oDoc.PrinterName
			msgbox(oprop,0,"[ PrinterName ]")
			oDoc.dispose
			Exit Sub
	oBad: 
			mErr = Error
			eline = Erl
			msgbox("Line : " & eline & Chr$(10) & mErr & Chr$(10) &" : i = " & i, 0,"Error Message" )
			oDoc.dispose
End SUb

Font

MDF-)[Math]CustomFontName


Sub oPropInfo
	Dim oDoc
	Dim oDummy()
		On Error Goto oBad 
			oDoc = StarDesktop.loadComponentFromURL("private:factory/smath", "_blank", 0, oDummy())
				oprop1 = oDoc.CustomFontNameFixed
				oprop2 = oDoc.CustomFontNameSans
				oprop3 = oDoc.CustomFontNameSerif 
			msgbox(" CustomFontNameFixed  => " & oprop1 & Chr$(10) & _
						" CustomFontNameSans => " & oprop2 & Chr$(10) & _
						" CustomFontNameSerif  => " & oprop3 ,0,"[ CustomFontName ]")
			oDoc.dispose
			Exit Sub
	oBad: 
			mErr = Error
			eline = Erl
			msgbox("Line : " & eline & Chr$(10) & mErr & Chr$(10) &" : i = " & i, 0,"Error Message" )
			oDoc.dispose
End SUb

MDF-)[Math]FontNameFunctions


Sub oPropInfo
	Dim oDoc
	Dim oDummy()
		On Error Goto oBad 
			oDoc = StarDesktop.loadComponentFromURL("private:factory/smath", "_blank", 0, oDummy())
				oprop = oDoc.FontNameFunctions
			msgbox(oprop,0,"[ FontNameFunctions ]")
			oDoc.dispose
			Exit Sub
	oBad: 
			mErr = Error
			eline = Erl
			msgbox("Line : " & eline & Chr$(10) & mErr & Chr$(10) &" : i = " & i, 0,"Error Message" )
			oDoc.dispose
End SUb

MDF-)[Math]FontNameNumbers


Sub oPropInfo
	Dim oDoc
	Dim oDummy()
		On Error Goto oBad 
			oDoc = StarDesktop.loadComponentFromURL("private:factory/smath", "_blank", 0, oDummy())
				oprop = oDoc.FontNameNumbers
			msgbox(oprop,0,"[ FontNameNumbers ]")
			oDoc.dispose
			Exit Sub
	oBad: 
			mErr = Error
			eline = Erl
			msgbox("Line : " & eline & Chr$(10) & mErr & Chr$(10) &" : i = " & i, 0,"Error Message" )
			oDoc.dispose
End SUb

MDF-)[Math]FontNameVariables


Sub oPropInfo
	Dim oDoc
	Dim oDummy()
		On Error Goto oBad 
			oDoc = StarDesktop.loadComponentFromURL("private:factory/smath", "_blank", 0, oDummy())
				oprop = oDoc.FontNameVariables
			msgbox(oprop,0,"[ FontNameVariables ]")
			oDoc.dispose
			Exit Sub
	oBad: 
			mErr = Error
			eline = Erl
			msgbox("Line : " & eline & Chr$(10) & mErr & Chr$(10) &" : i = " & i, 0,"Error Message" )
			oDoc.dispose
End SUb








Top of Page

inserted by FC2 system