Save as JPEG Topic is solved
Save as JPEG
I am trying to save publisher files as JPEGs and would like to create a one stroke shortcut to save as JPEG instead of pulling down the file, clicking save as, and then dropping down the menu of file types to select JPEG. What is the proper code to write for this?
Re: Save as JPEG
windows 7
Re: Save as JPEG
I am working in microsoft publisher 2010
Re: Save as JPEG Topic is solved
You could try http://ahkscript.org/docs/commands/WinM ... ctItem.htm but that probably won't work. As it is MS application it might be able to record a VB Script Macro in Publisher itself to do it and assign a hotkey to it - if that won't work you could try simple send method:
Just write down the KEYSTROKES you need to type to save the file as JPG, for example
- Alt-f to open the file menu
- s to select the save as submenu
- alt-t to select the filetype
- Down X times to select JPG or just the J key 3 times
- Enter to save
- send a file name + Enter again
If that works, use the http://ahkscript.org/docs/commands/Send.htm to send those keystrokes.
Just write down the KEYSTROKES you need to type to save the file as JPG, for example
- Alt-f to open the file menu
- s to select the save as submenu
- alt-t to select the filetype
- Down X times to select JPG or just the J key 3 times
- Enter to save
- send a file name + Enter again
If that works, use the http://ahkscript.org/docs/commands/Send.htm to send those keystrokes.
Re: Save as JPEG
Try this.
When the user presses F1 in Publisher, they will be prompted to enter a name of a file to SaveAs .jpg.
When the user presses F1 in Publisher, they will be prompted to enter a name of a file to SaveAs .jpg.
Code: [Select all] [Expand] [Download] (Script.ahk)GeSHi © Codebox Plus
; Constants (use these to specify which resolution to use in SaveAsPicture below)
pbPictureResolutionDefault = 0
pbPictureResolutionWeb_96dpi = 1
pbPictureResolutionDesktopPrint_150dpi = 2
pbPictureResolutionCommercialPrint_300dpi = 3
return ; End of auto-execute section
#IfWinActive ahk_class MSWinPub
F1::
try ; try to get an instance of the Publisher application object
oPub := ComObjActive("Publisher.Application")
catch { ; if an instance of Publisher could not be found, do nothing
MsgBox, 0x10, Publisher not found!
return
}
; Prompt the user to enter a file name and path to SaveAs with
FileSelectFile, SavePath, S 16, %A_Desktop%, Enter a Name to save file as .jpg, (*.jpg)
if (ErrorLevel) ; If the user dismissed the dialog without selecting a file, return
return
; If the last four characters of the SavePath are not ".jpg", add the dot and extension
if (SubStr(SavePath, -3) != ".jpg")
SavePath .= ".jpg"
oPub.ActiveDocument.Pages(1).SaveAsPicture(SavePath, pbPictureResolutionCommercialPrint_300dpi)
return
#If
Esc::ExitApp
Who is online
Users browsing this forum: Chadderz94, Flipeador, inseption86 and 42 guests