Untitled Document

open source masterhelp,macro, vba, word, cdma, component, delphi, excel

How to Eliminate Zero Number in Front of Number

Some time we need a function in visual basic application but we never found that in VBA, so we must create by self that function. For example I have text number “0000100,00″ and I want to takeĀ  number “100,00″ only and I don’t need “0000″ in front of “100,00″ .

How to eliminate “0000″ …?

Continue Reading…

MaterHelp Create Pop Up Menu In Ms. Word

MasterHelp has two type menus, menu bar and PopUp Menu, Menu bar create manual / not programmming, But popup menu is created by copied menu bar.

Public Sub AddPopupMasterHelp()
Dim i
Dim sty As CommandBar
Set mydoc = ActiveDocument
For Each sty In mydoc.CommandBars
If sty.Type = 2 Then
PopupMasterHelp (sty.Name)
End If
Next sty
End Sub

Public Sub PopupMasterHelp(nama As String)
Dim ShortCutMenu As CommandBar
Dim MasterHelp As CommandBarPopup
Set MasterHelp = ShortCutMenu.Controls.Add(Type:=msoControlPopup, Temporary:=True)
With MasterHelp
.BeginGroup = True
.Caption = “&Master Help”
.OnAction = “Men1″
End With

end sub

Public Sub Men1()
Dim cbrOriginal As CommandBarControl
Dim ctlCBarControl As CommandBarControl
Dim lngBarType As Long
Dim Ctrl As CommandBarControl
Dim ThesaurusMenu As CommandBarPopup
System.Cursor = wdCursorWait
Set ThesaurusMenu = CommandBars.ActionControl
Set cbrOriginal = CommandBars(”Menu bar”).Controls(”Format”)
For Each Ctrl In ThesaurusMenu.Controls
Ctrl.Delete
Next Ctrl

For Each ctlCBarControl In cbrOriginal.Controls
With ThesaurusMenu.Controls.Add(Type:=msoControlButton, Temporary:=True)
On Error Resume Next
If ctlCBarControl.BeginGroup Then .BeginGroup = True
.Parameter = ctlCBarControl.Parameter
ctlCBarControl.CopyFace
.PasteFace
.Caption = ctlCBarControl.Caption
.OnAction = ctlCBarControl.OnAction
End With
Next ctlCBarControl
End Sub

Version Info In Ms. word

How to get information operating system in microsoft word..?

  • Press ALT+F11
  • Insert module
  • Write this code
  • Press F5

Sub Info()
Dim Ver$
Dim Env$
Env$ = WordBasic.[AppInfo$](1)
Ver$ = WordBasic.[AppInfo$](2)
MsgBox “Operating : ” + Env$ + Chr(13) + Chr(10) + Ver$

End Sub

User Define Function Dialogs

VBA word allow us to create form dialog using UDF Dialog, we can design the dialog as we like. This function need Microsoft Form 2.0 Obejct Library. In IDE Of VBA word we can choose Tools –> references–> choose CheckBox Microsoft Form 2.0 Obejct Library. and click OK

after that choose Insert Menu –> Module

write this code :

Continue Reading…

Insert Clip Art By Macro

Microsoft Word VBA has not function to call insert clip art dialogs, so we can take id control of insert clip art dialogs. The Id Control is 682, using commandbar we find id control 682 and then we execute this id.

Sub insert_clip_art()
Application.CommandBars.FindControl(ID:=682).Execute
End Sub

ceck file function

Public Function cekfile(dor As String, fil As String)

Dim i

With Application.FileSearch
.LookIn = dor
.FileName = fil

If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
‘MsgBox “There were ” & .FoundFiles.Count & _
‘ ” file(s) found.”
For i = 1 To .FoundFiles.Count
‘ MsgBox .FoundFiles(i)
Next i
GoTo betul
Else
GoTo salah
End If
End With

betul:
cekfile = True
GoTo bye
salah:
cekfile = False
GoTo bye
bye:
End Function

Is Template Exist in Template Folder..?

Public Sub hlpfile()
Dim ProjectPath$
Dim Project$
Dim dotpath$
Dim myTemplate
Dim TempPath$
Dim dot$
Dim masterdot$
Dim tempdot$
Dim masterhlp$
Dim temphlp$
Dim pesan
On Error Resume Next
Set myTemplate = ActiveDocument.AttachedTemplate
TempPath$ = myTemplate.path ‘& Application.PathSeparator
dot$ = “\” + myTemplate.Name
dotpath$ = Application.NormalTemplate.path
masterhlp$ = TempPath$ + “\MasterHelp.dot”
temphlp$ = dotpath$ + “\MasterHelp.dot”
If Not cekfile(dotpath$, “MasterHelp.dot”) Then
GoTo kirim
Else
GoTo bye
End If
kirim:

Continue Reading…

Show All Hidden Menu In Ms. Word

Microsoft Word has more than 1000 menus, all of there we can call by macro, yes with macro only we can puting out in word document.

Sub ListMenu()
Dim i
Dim sty As CommandBar
Set mydoc = ActiveDocument
For Each sty In mydoc.CommandBars
‘If sty.Type = 2 Then
Selection.Font.Bold = wdToggle
Selection.Font.Color = wdColorRed
Selection.TypeText Text:=”type : ” + Str(sty.Type) + ” ”
Selection.TypeText Text:=sty.Name
Selection.TypeParagraph

Selection.Font.Bold = wdnormal
Selection.Font.Color = wdColorBlack

For i = 1 To CommandBars(sty.Name).Controls.Count
If CommandBars(sty.Name).Controls.item(i).BeginGroup Then
Selection.TypeText Text:=”============”
Selection.TypeParagraph

End If
Selection.TypeText Text:=”ID : ” + Str(CommandBars(sty.Name).Controls.item(i).ID) + ” ” + CommandBars(sty.Name).Controls.item(i).Caption
Selection.TypeParagraph
Next i
‘End If
Next sty
End Sub

addin Coverting number to rupiah text currency

[Function]Coverting number to rupiah text currency
Senin, 31 Maret 08 - oleh : edy

how to convert number to spelling text in rupiah currency

Public Function terbilang(x As Currency)
Dim triliun As Currency
Dim milyar As Currency
Dim juta As Currency
Dim ribu As Currency
Dim satu As Currency
Dim sen As Currency
Dim baca As String

Continue Reading…

|