This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public data As String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' OutputFileName : hogehoge(*date*-*time**initial*).doc | |
''' eg. hogehoge(20120101-1200dck).doc | |
Sub SaveAndRename() | |
Dim fileNameBody As String ' hogehoge in above example | |
Dim newFileName As String | |
Dim saveDate As String : saveDate = Format(Date, "yymmdd") | |
Dim saveTime As String : saveTime = Format(Time, "hhmm") | |
Dim initial As String : initial = "dck" | |
Dim re, mc, m | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Private Const SE_SHUTDOWN_NAME = "SeShutdownPrivilege" | |
Private Const SE_PRIVILEGE_ENABLED = &H2 | |
Private Const ANYSIZE_ARRAY = 1 | |
Private Const TOKEN_ALL_ACCESS = &HF00FF | |
Private Type LUID | |
LowPart As Long | |
HighPart As Long | |
End Type |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function GetMacAddress() | |
Dim objNetwork As Object | |
Dim strNetworkSql As String | |
Dim strMacAdr As String | |
strNetworkSql = "SELECT * FROM Win32_NetworkAdapter WHERE MACAddress IS NOT NULL" | |
For Each objNetwork In GetObject("winmgmts:").ExecQuery(strNetworkSql) | |
strMacAdr = objNetwork.MACAddress | |
If strMacAdr <> "" Then Exit For | |
Next |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Attribute VB_Name = "ModuleToolbar" | |
Option Explicit | |
Const toolbarName = "SampleToolbar" | |
Sub MakeToolBar() | |
Dim myBar As CommandBar | |
Dim myButton1 As CommandBarControl | |
Set myBar = Application.CommandBars.Add( _ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Attribute VB_Name = "ModuleToolbar" | |
Option Explicit | |
Const toolbarName = "Sample" | |
Sub MakeToolBar() | |
Dim myBar As CommandBar | |
Set myBar = Application.CommandBars.Add( _ | |
Name:=toolbarName, Position:=msoBarFloating) | |
myBar.Visible = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja"> | |
<head> | |
<title>HTML5 Tetris</title> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=9"/> | |
<link rel='stylesheet' href='style.css' /> | |
</head> | |
<body> | |
<canvas width='300' height='600'></canvas> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Yet another Task.Exists() | |
' Task.Exists() Method does not always work well. | |
' processName : executeFileName eg. "notepad.exe" | |
Function TaskExists(processName As String) | |
Dim Locator : Set Locator = CreateObject("WbemScripting.SWbemLocator") | |
Dim Server : Set Server = Locator.ConnectServer | |
Dim objSet : Set objSet = Server.ExecQuery("Select * From Win32_Process") | |
Dim obj | |
For Each obj In objSet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VERSION 1.0 CLASS | |
BEGIN | |
MultiUse = -1 'True | |
END | |
Attribute VB_Name = "VAMIE2" | |
Attribute VB_GlobalNameSpace = False | |
Attribute VB_Creatable = False | |
Attribute VB_PredeclaredId = False | |
Attribute VB_Exposed = False | |
Option Explicit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub ResetAllCommandBars() | |
Dim objCommandBar As Office.CommandBar | |
For Each objCommandBar In Application.CommandBars | |
If objCommandBar.BuiltIn Then | |
objCommandBar.Reset | |
End If | |
Next | |
End Sub |
OlderNewer