�悭����l�^�ł����A���������Ƃ��āB
Const ssfDESKTOP = &H0 ' Desktop Const ssfPERSONAL = &H5 ' My Documents Const ssfMYPICTURES = &H27 ' My Pictures Const ssfWINDOWS = &H24 ' Windows Function GetNewFolderPath(IstrMessage, IlngRoot) GetNewFolderPath = "" Dim objWShell, objFolder Set objWShell = WScript.CreateObject("Shell.Application") Set objFolder = objWShell.BrowseForFolder(0, IstrMessage, 0, IlngRoot) If (Not objFolder Is Nothing) Then GetNewFolderPath = objFolder.Self.Path End If Set objFolder = Nothing Set objWShell = Nothing End Function Msgbox GetNewFolderPath("Select Folder", ssfPERSONAL)
�L�����Z������Ƌ��Ԃ��Ă���݂����ȁB
VBA(VB) �ɂ͕�������r���� Like �Ƃ������Z�q������܂��B ������g�p����ƊȒP�ȃp�^�[�������Ȃ琳�K�\���╶��������g�p������ �ς܂��邱�Ƃ��ł��܂��B
If "abc" Like "a??" Then ... ' ��True
[�Q�l�T�C�g]
Excel(�G�N�Z��)VBA����FFind���\�b�h,Like���Z�q���g��������
# �Ő����ƃ}�b�`�����邱�Ƃ��ł��܂��� �S���p���Ȃ��̂ŁA�����ɔ��p�������`�F�b�N���鎞�� ���̂悤�� [] ���g�p���܂��B
If "3" Like "#" Then ... ' ��True If "�S" Like "#" Then ... ' ������� True �ɂȂ� If "3" Like "[0-9]" Then ... ' ��True If "�S" Like "[0-9]" Then ... ' ������� False �ɂȂ�
Excel �� VBA �� �N���b�v�{�[�h�Ƀf�[�^���i�[����ꍇ DetaObject ���g�����@������܂��B
�Q�Ɛݒ�������� DetaObject ���g���ꍇ ���̂悤�ɏ��������Ȃ�܂����A ����̓G���[�ɂȂ�܂��B
Set Clip = CreateObject("MSFORMS.DataObject")
�F�X�ƒ��ׂĂ݂�ƁA���̂悤�ɐ錾�ł���悤�ł��B
CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
����𗘗p����� �Q�Ɛݒ肹���� �ȒP�ɃN���b�v�{�[�h�ɕ�������i�[�ł��܂��B
With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
.SetText "���̕�������N���b�v�{�[�h�Ɋi�[���܂�"
.PutInClipboard
End With
CDO �R���|�[�l���g���g�p����� VBS �� VBA ����ȒP�Ƀ��[���𑗐M���邱�Ƃ��ł��܂��B
���̕\�̊��� CDO �R���|�[�l���g�𗘗p���邱�Ƃ��ł��܂��B
| �� | CDO���p | SMTP�T�[�r�X |
|---|---|---|
| Windows 2000 Professional | �� | ���i�f�t�H���g�n�j�j |
| Windows 2000 Server | �� | ���i�f�t�H���g�n�j�j |
| Windows XP Professional | �� | ���i�f�t�H���g�n�j�j |
| Windows XP Home Edition | �� | �~ |
| Windows Server 2003 | �� | ���i�v�}�j���A���ݒ�j |
VBS �̏ꍇ�A���̂悤�ɏ����܂��B
Set objCdoMessage = CreateObject("CDO.Message")
With objCdoMessage
.From = "���M���� <xxxxx@example.com>"
.To = "���M�於 <yyyyy@example.com>"
.Subject = "����"
.TextBody = "���b�Z�[�W"
.Send
End With
Set objCdoMessage = Nothing
���������ꂾ���Ń��[���𑗂邱�Ƃ��ł��܂��B
�������A��̕\�� SMTP �T�[�r�X���A�~�ɂȂ��Ă��� Windows XP Home Edition �� ���̃T���v���̂悤�� �O���� SMTP �T�[�r�X���w�肷��K�v������܂��B
Const cdoSendUsing = _
"http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSmtpServer = _
"http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSmtpServerPort = _
"http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Set objCdoMessage = CreateObject("CDO.Message")
With objCdoMessage
.Configuration.Fields.Item(cdoSendUsing) = 2
.Configuration.Fields.Item(cdoSmtpServer) = "mail.example.com"
.Configuration.Fields.Item(cdoSmtpServerPort) = 25
.Configuration.Fields.Update
.From = "���M���� <xxxxx@example.com>"
.To = "���M�於 <yyyyy@example.com>"
.Subject = "����"
.TextBody = "�e�X�g���b�Z�[�W�ł�"
.Send
End With
Set objCdoMessage = Nothing
���̗�ł� mail.example.com �� 25 �ԃ|�[�g�� SMTP �T�[�o�Ƃ��Ďw�肵�Ă��܂��B
���Ȃ݂� Const �Œ�`���Ă��� URL �� �A�N�Z�X����̂ł͂Ȃ� SMTP �T�[�o��ݒ肷�邽�߂� ���ʎq�Ƃ��ė��p����܂��B
Java �Ȃǂł́AtoString ���\�b�h������ �I�u�W�F�N�g��\�����镶�����Ԃ����Ƃ��ł��܂��B
VB6 �� VBS �ŁA�����悤�ɃI�u�W�F�N�g�����\�b�h������ �w�肵�����ɁA�I�u�W�F�N�g�̒l���o�͂��邱�Ƃ��ł���� �f�o�b�N�Ȃǂɖ��ɗ��������ł��B
VB6 �� VBS �̏ꍇ�A ���̗�̂悤�� Default ���w�肵�� Get �v���p�e�B���쐬���܂��B �i���O�͉��ł�OK�ł��j
Class Test
Public Default Property Get ToString()
ToString = "Test Class"
End Property
End Class
���̂悤�ɃI�u�W�F�N�g�����\�b�h�Ȃ��Ŏw�肷��A �uTest Class�v�ƕ\������܂��B
Dim t Set t = New Test Msgbox t
VB6�ł́A�t�@�C���o�͎��� Print ���\�b�h���g�p���܂��B
Print #1, "Hello!" & vbNewLine & "Good-Bye!"
����ʼn��̂悤�ɏo�͂���܂��B
Hello! Good-Bye!
�����A�����ōŌ�̍s�ɂ����s�������Ă��܂��܂��B ����� Print ���\�b�h�����s��}�����邩��ł��B
���s�̑}�����~�߂�ɂ́A �Ō�ɃZ�~�R�����u;�v��t���܂��B
Print #1, "Hello!" & vbNewLine & "Good-Bye!";
Hello! Good-Bye!
����ʼn��s���}������܂���B
VB6�͍��X�ł����AExcel2007��VBA�ł��g���܂��B