Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

write to registry DWORD, how

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
1078 Views, 2 Replies

write to registry DWORD, how

Want to send email via a command but everytiime Outlook throughs a warning. I want to turn this warning off via the registry.

The code below creates REG_SZ but I need DWORD.

 

(defun c:test ()

(vl-registry-write "HKEY_CURRENT_USER\\Software\\Policies\\Microsoft\\Office\\15.0\\outlook\\security" "AdminSecurityMode" "3")
(vl-registry-write "HKEY_CURRENT_USER\\Software\\Policies\\Microsoft\\Office\\15.0\\outlook\\security" "PromptOOMSend" "2")
(vl-registry-write "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Office\\15.0\\Outlook\\Security" "ObjectModelGuard" "2")
)

 

I have found this, but it does not work nor do i understand it. (below)

 

(defun c:testing ()
(setq wssh (vlax-create-object "WScript.Shell"))

(vlax-invoke-method wssh 'RegWrite "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Office\\15.0\\Outlook\\Security"
(vlax-make-variant 0 2) "REG_DWORD")

(vlax-release-object wssh)
)

 

Any thoughts

2 REPLIES 2
Message 2 of 3
diagodose2009
in reply to: Anonymous

Already we develope converter registry to visual -lisp. If you are programmer,then i can insert your-sources in our-project.. Please you contact us at link-bellow
Message 3 of 3
Anonymous
in reply to: Anonymous

Here is a snipet from the finished working code. This was part of a larger "if" statement for turning off the outlook security warning when sending an email via the lisp.

 

 

(progn
;;;turn msoutlook warning off
(alert "Your Outlook settings must be updated. The system will Close Outlook and reopen it now. This is a one time setup operation.")
(vl-registry-write "HKEY_CURRENT_USER\\Software\\Policies\\Microsoft\\Office\\15.0\\outlook\\security" "PromptOOMSend" 2)
(vl-registry-write "HKEY_CURRENT_USER\\Software\\Policies\\Microsoft\\Office\\15.0\\outlook\\security" "AdminSecurityMode" 3)
(vl-registry-write "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Office\\15.0\\Outlook\\Security" "ObjectModelGuard" 2)
;;;end regedit

;;;close and reopen outlook with batch operation
(command "shell" "\\\\cporldata\\trust\\Software\\Batch\\Closerestartoutlook.bat")

;;;end

;;;get date and time then write to log file
(setq mooddate (menucmd "m=$(edtime,$(getvar,DATE),MO/DD/YY)"))
(setq moodtime (menucmd "m=$(edtime,$(getvar,DATE),HH:MM:SS)"))
(setq combine (strcat mooddate "," moodtime "," "Help"))
(setq f (open "\\\\cporldata\\Antikythera\\MoraleLog.csv" "a"))
(write-line combine f)
(close f)

;;;end

;;;send email
(setq olApp (vlax-get-or-create-object "Outlook.Application"))
(setq objMail (vlax-invoke olApp 'CreateItem 0))
(vlax-put-property objMail 'Subject "my subject")
(vlax-put-property objMail 'To "email@address")
(vlax-put-property objMail 'Body "message body.")
(vlax-invoke objMail 'Send)
;;;end if not
)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report