« Acrobat21.007.20096xアップデート | トップページ | Adobe Content Authenticity Initiative (CAI) »

[OutLook]引用符挿入

昭和な『おぢさん』からの依頼
選択範囲の行頭に>引用符を挿入します。

ダウンロード - microsoft20outlook.zip

Outlook


tell application "Microsoft Outlook"
set theSelectedText to selected text as text
end tell

set AppleScript's text item delimiters to "\n"
set listSelectedText to every text item of theSelectedText
set numCntList to count of listSelectedText
set numCntText to 1 as integer
set theReplaceText to "" as text

repeat numCntList times
if numCntText is 1 then
set theReplaceText to theReplaceText & (">" & (item numCntText of listSelectedText) as text) as text
else
set theReplaceText to theReplaceText & "\n" & (">" & (item numCntText of listSelectedText) as text) as text
end if
set numCntText to (numCntText + 1) as integer
end repeat
----最後に改行いれる処理(お好みで)
set theReplaceText to (theReplaceText & "\n") as text

tell application "Microsoft Outlook"
set selected text to theReplaceText as text
end tell



--------------文字の置き換えサブルーチン
to doReplace(theText, theOrgStr, theNewStr)
set theOldDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to theOrgStr
set theTmpList to every text item of theText
set AppleScript's text item delimiters to theNewStr
set theReplaceStr to theTmpList as text
set AppleScript's text item delimiters to theOldDelim
return theReplaceStr
end doReplace

|

« Acrobat21.007.20096xアップデート | トップページ | Adobe Content Authenticity Initiative (CAI) »

Office」カテゴリの記事