זה לא עוזר לי...
Sub ChangeCommentWith()
Dim myRegKey As String
Dim myValue As String
Dim myFileAs As String
Dim myAnswer As Integer
'get registry key to work with
myRegKey = "HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\MailSettings\MarkComments"
If myRegKey = "" Then Exit Sub
'check if key exists
If RegKeyExists(myRegKey) = True Then
'key exists, read it
myValue = RegKeyRead(myRegKey)
If myValue = 1 Then myValue = "0" Else myValue = 1
Else
myValue = 1
End If
If myValue <> "" Then
RegKeySave myRegKey, myValue
MsgBox "Registry key set to " & myValue
End If
End Sub
'reads the value for the registry key i_RegKey
'if the key cannot be found, the return value is ""
Function RegKeyRead(i_RegKey As String) As String
Dim myWS As Object
On Error Resume Next
'access Windows scripting
Set myWS = CreateObject("WScript.Shell")
'read key from registry
RegKeyRead = myWS.RegRead(i_RegKey)
End Function
'sets the registry key i_RegKey to the
'value i_Value with type i_Type
'if i_Type is omitted, the value will be saved as string
'if i_RegKey wasn't found, a new registry key will be created
' change REG_DWORD to the correct key type
Sub RegKeySave(i_RegKey As String, _
i_Value As String, _
Optional i_Type As String = "REG_DWORD")
Dim myWS As Object
'access Windows scripting
Set myWS = CreateObject("WScript.Shell")
'write registry key
myWS.RegWrite i_RegKey, i_Value, i_Type
End Sub
'returns True if the registry key i_RegKey was found
'and False if not
Function RegKeyExists(i_RegKey As String) As Boolean
Dim myWS As Object
On Error GoTo ErrorHandler
'access Windows scripting
Set myWS = CreateObject("WScript.Shell")
'try to read the registry key
myWS.RegRead i_RegKey
'key was found
RegKeyExists = True
Exit Function
ErrorHandler:
'key was not found
RegKeyExists = False
End Function
זה נראה עובד, אבל יש לך מושג איך אני גורם לקריקטוריון להיות נצרך שבלעדיו האקסס לא יעלה?תבדוק את זה:
קוד:Sub ChangeCommentWith() Dim myRegKey As String Dim myValue As String Dim myFileAs As String Dim myAnswer As Integer 'get registry key to work with myRegKey = "HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\MailSettings\MarkComments" If myRegKey = "" Then Exit Sub 'check if key exists If RegKeyExists(myRegKey) = True Then 'key exists, read it myValue = RegKeyRead(myRegKey) If myValue = 1 Then myValue = "0" Else myValue = 1 Else myValue = 1 End If If myValue <> "" Then RegKeySave myRegKey, myValue MsgBox "Registry key set to " & myValue End If End Sub 'reads the value for the registry key i_RegKey 'if the key cannot be found, the return value is "" Function RegKeyRead(i_RegKey As String) As String Dim myWS As Object On Error Resume Next 'access Windows scripting Set myWS = CreateObject("WScript.Shell") 'read key from registry RegKeyRead = myWS.RegRead(i_RegKey) End Function 'sets the registry key i_RegKey to the 'value i_Value with type i_Type 'if i_Type is omitted, the value will be saved as string 'if i_RegKey wasn't found, a new registry key will be created ' change REG_DWORD to the correct key type Sub RegKeySave(i_RegKey As String, _ i_Value As String, _ Optional i_Type As String = "REG_DWORD") Dim myWS As Object 'access Windows scripting Set myWS = CreateObject("WScript.Shell") 'write registry key myWS.RegWrite i_RegKey, i_Value, i_Type End Sub 'returns True if the registry key i_RegKey was found 'and False if not Function RegKeyExists(i_RegKey As String) As Boolean Dim myWS As Object On Error GoTo ErrorHandler 'access Windows scripting Set myWS = CreateObject("WScript.Shell") 'try to read the registry key myWS.RegRead i_RegKey 'key was found RegKeyExists = True Exit Function ErrorHandler: 'key was not found RegKeyExists = False End Function
מקור
הוא מסמן לי שגיאה:תוסיף אירוע בעת טעינה על הטופס הראשון שאתה פותח, שבודק את הנתון.
אם הוא שונה ממה שבא לך, שהקובץ ייסגר.
בס"ד
אני זקוק למודול באקסס שפתיחת הקובץ מבקש מהרגיסטרי נתונים
מי שיש לו כזה ויוכל להעביר לי את זה אני יודה לו מאד.
לוח לימודים
מסלולי לימוד שאפשר לההצטרף
אליהם ממש עכשיו:
4.06
כ"ז אייר
סילבוס חדש ל-2024!
קורס פיתוח ובניית אתרים
קריירה מתקדמת, ביקוש עצום, וממוצע משכורות גבוה במיוחד!
מלגות גבוהות ומשתלמות!
2.06
כ"ה אייר
פתיחת מסלול
קורס עריכת וידאו
מלגות והנחות משמעותיות!
4.06
כ"ז אייר
#רקבפרוג
הרצאה מרתקת:
הכירו את טווינמושן
עם גל אקסלרוד
עולם מטורף משל הדמיות! ממשק חדשני שמאפשר לבצע הדמיה כמעט כמו משחק מחשב
לתלמידים ובוגרים בלבד!
27.06
כ"א סיוון
פתיחת מסלול
עיצוב ואדריכלות פנים
מלגות גבוהות!
27.06
כ"א סיוון
השקה חגיגית!
עיצוב גרפי ודיגיטל - בסילבוס חדש ומטורף!
מלגות גבוהות!
תהילים פרק קמז
א הַלְלוּיָהּ כִּי טוֹב זַמְּרָה אֱלֹהֵינוּ כִּי נָעִים נָאוָה תְהִלָּה:ב בּוֹנֵה יְרוּשָׁלִַם יְהוָה נִדְחֵי יִשְׂרָאֵל יְכַנֵּס:ג הָרֹפֵא לִשְׁבוּרֵי לֵב וּמְחַבֵּשׁ לְעַצְּבוֹתָם:ד מוֹנֶה מִסְפָּר לַכּוֹכָבִים לְכֻלָּם שֵׁמוֹת יִקְרָא:ה גָּדוֹל אֲדוֹנֵינוּ וְרַב כֹּחַ לִתְבוּנָתוֹ אֵין מִסְפָּר:ו מְעוֹדֵד עֲנָוִים יְהוָה מַשְׁפִּיל רְשָׁעִים עֲדֵי אָרֶץ:ז עֱנוּ לַיהוָה בְּתוֹדָה זַמְּרוּ לֵאלֹהֵינוּ בְכִנּוֹר:ח הַמְכַסֶּה שָׁמַיִם בְּעָבִים הַמֵּכִין לָאָרֶץ מָטָר הַמַּצְמִיחַ הָרִים חָצִיר:ט נוֹתֵן לִבְהֵמָה לַחְמָהּ לִבְנֵי עֹרֵב אֲשֶׁר יִקְרָאוּ:י לֹא בִגְבוּרַת הַסּוּס יֶחְפָּץ לֹא בְשׁוֹקֵי הָאִישׁ יִרְצֶה:יא רוֹצֶה יְהוָה אֶת יְרֵאָיו אֶת הַמְיַחֲלִים לְחַסְדּוֹ:יב שַׁבְּחִי יְרוּשָׁלִַם אֶת יְהוָה הַלְלִי אֱלֹהַיִךְ צִיּוֹן:יג כִּי חִזַּק בְּרִיחֵי שְׁעָרָיִךְ בֵּרַךְ בָּנַיִךְ בְּקִרְבֵּךְ:יד הַשָּׂם גְּבוּלֵךְ שָׁלוֹם חֵלֶב חִטִּים יַשְׂבִּיעֵךְ:טו הַשֹּׁלֵחַ אִמְרָתוֹ אָרֶץ עַד מְהֵרָה יָרוּץ דְּבָרוֹ:טז הַנֹּתֵן שֶׁלֶג כַּצָּמֶר כְּפוֹר כָּאֵפֶר יְפַזֵּר:יז מַשְׁלִיךְ קַרְחוֹ כְפִתִּים לִפְנֵי קָרָתוֹ מִי יַעֲמֹד:יח יִשְׁלַח דְּבָרוֹ וְיַמְסֵם יַשֵּׁב רוּחוֹ יִזְּלוּ מָיִם:יט מַגִּיד (דברו) דְּבָרָיו לְיַעֲקֹב חֻקָּיו וּמִשְׁפָּטָיו לְיִשְׂרָאֵל:כ לֹא עָשָׂה כֵן לְכָל גּוֹי וּמִשְׁפָּטִים בַּל יְדָעוּם הַלְלוּיָהּ: