搜尋此網誌

2017年12月14日 星期四

如何在電子檔中一次攫取出e散在各各段落的email address,不用一筆一筆key in?,可利用word or online web site (PDF email extractor)

有時候我們手邊拿到一份會員名單電子檔,想要利用電子檔中的email list,難道要一筆一筆重key or copy paste嗎?
當然有快速的方式:

  1. 利用現成的軟體直接將電子檔喂進去,自然就將所有email取出,然後變成excel檔,ex:Email Address Collector 
  2. 利用線上online工具直接轉換,免費free,方便使用(我有用過),但會不會有email外洩的疑慮? 需要使用者自行考量,ex: emailHIPPO's Free Online Email Extractor
  3. 利用word的搜尋功能也能達到目地哦!!
  1. 將欲判別的文章貼到word(不用管格式)
  2. word的進階尋找中,輸入字串[A-z,0-9,\.,\-]{1,}\@[A-z,0-9,\.]{1,} 全部尋找後,其會將文中是email的字串全部標示(mark)出來,並將其複製,貼至excel,哇!~~一份email address名單完成。


2017年10月13日 星期五

MS word功能變數的應用,功能變數的英文是field code

MS word功能變數的應用問題(每個子題在下方均有說明)
  1. 大家知道「功能變數」 ,「合併列印」的英文是什麼嗎??
  2. 簡單記錄一下功能變數if的應用
  3. 如果if中的條件有兩個的話要如何做呢?
  4. 如何讓沒有值的功能變數不印出空白行?
  5. 如何在「合併列印」使用「功能變數」時可以自動編號?
  6. 所有功能變數的語法
---------------------------------------------------------------
大家知道「功能變數」 ,「合併列印」的英文是什麼嗎??
  • 「功能變數」field code 是的就是field code,如此找英文資料就比較好找啦!!
  • 「合併列印」的英文是mail merge
這篇要簡單記錄一下功能變數if的應用,如果if中的條件有兩個的話要如何做呢? (實作過喲~~)
  • {IF { = OR({COMPARE{MERGEFIELD "Field_A"} = 0}, {COMPARE{MERGEFIELD "Field_B"} = "ABC_TEXT"} )} = 1 "Show成立" "Show條件不成立"}
  • {IF { = AND({COMPARE{MERGEFIELD "Field_A"} = 0}, {COMPARE{MERGEFIELD "Field_B"} = "ABC_TEXT"} )} = 1 "Show成立" "Show條件不成立"}
重點來了,多條件怎麼處理? 也許這個可以處理:
  • {IF { = {if {MERGEFIELD "Field_A"} = 0 10} + {IF {MERGEFIELD "Field_B"} = 0 10} + {IF {MERGEFIELD "Field_C"} = 0 10}} = 30 "PASS" "FAIL"}
這個最厲害...

參考macropod [Microsoft MVP - Word]寫的

You can build a multiple AND test this way:
{IF{={IF{MERGEFIELD 1}= "Y" 1 0}*{IF{MERGEFIELD 2} 2 1 0}*{IF{MERGEFIELD 3}= "text" 1 0}}= 1 "True Text" "False Text"}

Similarly, you can build a multiple OR test this way:
{IF{={IF{MERGEFIELD 1}= "Y" 1 0}+{IF{MERGEFIELD 2} 2 1 0}+{IF{MERGEFIELD 3}= "text" 1 0}} > 0 "True Text" "False Text"}

https://answers.microsoft.com/en-us/office/forum/office_2013_release-word/is-there-a-limit-to-word-2013-and-and-or/6e47059c-e851-4ac6-8750-ad58e4fd8e80?auth=1

有個老師的網站很棒,有教學~~~必看
http://thinker-evans.blogspot.tw/2014/09/office-word-200720102013_21.html

實用

如何讓沒有值的功能變數不印出空白行? 例如下面範例使用了\f switch,如果變數street_address2沒有值,它不會印出空白行,在實務上非常好用的~~~請注意下方黃色標示的說明,也可同時前加字後也加字 感謝熱心網友的PO文「Mail Merge Switches

Selective Line Break Insertion
Use \b and \f switches to insert line breaks when needed.
\b - Specifies the text to be inserted before the MERGEFIELD field if the field is not blank.
\f - Specifies the text to be inserted following the MERGEFIELD field if the field is not blank.
EXAMPLE
{MERGEFIELD street_address1}
{MERGEFIELD street_address2 \f "↲"}
{MERGEFIELD city}, {MERGEFIELD state} {MERGEFIELD zip}
 
Replace  with an actual line break (Shift-Enter)
If all fields are not blank, the result will be
123 Main
MS 123
Any Town, CA 00000
If street_address2 is blank, the result will be
123 Main
Any Town, CA 00000
Without the \f switch, there would be an empty line between street_address1 and the city/state/zip line.

請參考以下網址也有詳細說明:
Office 2010 Don't print blank lines when data fields are empty

如何在「合併列印」使用「功能變數」時可以自動編號?

可能自動編號的,使用SEQ功能變數

https://www.youtube.com/watch?v=IPuIcxXux-4
https://support.office.com/en-us/article/seq-sequence-field-062a387b-dfc9-4ef8-8235-29ee113d59be
https://stackoverflow.com/questions/33797829/ms-word-mailmerge-autonumbering-for-mergefield


參考資料

List of field codes in Word (所有功能變數的語法)

2017年9月18日 星期一

在WORD中,如何限制一行只能輸入固定的字數How to Limit the Characters Per Line in Microsoft Word

在一篇文章中若規定每一行只能70個字,在ms word中會怎麼做呢??

重點是:要視你規定每一行的字數是以純中文字或純英文字來計算而不一樣。

中文版的word如規定每一行中文字的字數,那就簡單了,就暫不介紹了。

今天要設定的是純英文的,如果規定一行限制60個英文字,這樣要如何設定呢?

1.開啟一個新word文件

2.設定字型成Courier New、 Monaco or Andale Mono

3.字型大小為12

4.算計欄寬:因為12號字在1 inch中可以放入10個字,而此案例要求一行要60個英文字,所以欄寬=60 / 10 = 6 inch,所以請調整左右邊界,使欄寬成為6 inch。

5.設定下圖
6.設定下圖

完工。

可參考其它網友的解如下:
http://www.ehow.co.uk/how_8296948_limit-per-line-microsoft-word.html

Double-click the Microsoft Word application icon to launch the application. Click the arrow to the right of the assigned font in the font menu bar and select a monospaced font from the drop-down menu. Courier, Courier New, Monaco and Andale Mono are a few examples of monospaced fonts.
Click the arrow to the right of the assigned font size and select "12" from the font size drop-down menu. The font size 12 allows 10 characters per inch, making it easy to limit the amount of characters per line.
Use the equation "Characters per line / characters per inch = Print area in inches" to determine the amount of print area required to limit the amount of characters per line. For example, if you want 60 characters per line, the equation would be "60 / 10 = 6 inches."
Subtract the number obtained in Step 3 from 8.5 and divide the resulting number by 2. The resulting number is the required width of the document's left and right margins. For the example, "8.5 - 6 = 2.5" and "2.5 / 2 = 1.25." The left and right margins for the example document would both be 1.25 inches.
Click the "Layout" tab. In the space labelled "Left" beneath the "Margins" heading, type the margin size obtained in Step 4 and press the "Enter" key. In the space labelled "Right" beneath the "Margins" heading, type the margin size obtained in Step 4 and press the "Enter" key. Each line of the document will now be limited to the desired number of monospaced characters.






2017年8月24日 星期四

word合併列印其功能變數內容如果有換行(return)多行的情形,要怎麼處理呢?

word合併列印是一個非常好用的功能,而每個資料欄位通常只有一行,但如果某一資料欄位是多行的,那要如何處理呢功能變數內容是多行的情況(return)。

不要想太多,只要用雙引號括起來即可。

以下列子,是利用「|」分欄(column),是利用enter(return)來分列(row)

Email|startdate|enddate|period
abc@tai.com.tw |08/10/2017|08/20/2017|08/08/2017
08/20/2017
chris@ir.com.tw |08/10/2017|08/20/2017|08/09/2017
08/12/2017

08/11/2017

2017年7月28日 星期五

利用Exchange management powershell下指令,自動刪除帳號大於30天前的資料Delete a users emails older than X days

Delete a users emails older than X days
如果exchange管理者想每天自動刪除某些帳號X天以前的email要如何做呢?

指令1:刪除30天前的帳號USERNAME內容
$Today = (Get-Date).adddays(-30).ToString("MM/dd/yyyy") ; Search-Mailbox USERNAME -SearchQuery "Received:$Today" -deleteContent -force

指令2:刪除10天前的帳號administrator內容
$Today = (Get-Date).adddays(-10).ToString("MM/dd/yyyy") ; Search-Mailbox administrator -SearchQuery "Received:$Today" -deleteContent -force

指令3:刪除10天前屬於Ann帳號 email的內容,不會刪除到連絡人、行事曆內容
$Today = (Get-Date).adddays(-10).ToString("MM/dd/yyyy") ; Search-Mailbox ann -SearchQuery "Received:$Today AND kind:email" -deleteContent -force

指令4:刪除12天前屬於Ann帳號 email及行事曆的內容不會刪除到連絡人
$Today = (Get-Date).adddays(-12).ToString("MM/dd/yyyy") ; Search-Mailbox ann -SearchQuery "Received:$Today AND (kind:email OR kind:meetings)" -deleteContent -force


如何在排程中下這些指令呢?
PowerShell.exe -command ". 'D:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; D:\administrator-30day.ps1"

kind指令要如何下呢??請參考Advanced Query Syntax (AQS)

其它參考資料:
How to delete email from mailboxes on Exchange 2016 / 2013 / 2010 / Online
Search-mailbox restricted to single sub-folder
Powershell/Exchange - Delete a users emails older than X days and X size




2017年6月22日 星期四

Acrobat PDF表單製作javascript學習筆記


Acrobat DC SDK Documentation 文件中有欄位屬性及例子(Field properties)

有關PDF Form問題之討論區 官方討論區

Acrobat Library 有很好的javascript教學 & 範例

Creating a referenced text field in a form


Dynamically setting a submit by e-mail address using Acrobat X and XI 在編輯的檔案中click一個button即將此pdf內容attachment至outlook發出,有例子可download


Lets say I have Buttons A and B and text field "Text1" I need code so when I press button A it change fill color of text field to(example green) and when i press button B it change text field to green also but if it is already green(because of button A) then change color to (example red).Can you Guys help pls?
You can use this code:
var field1 = this.getField("Text1");  
if (color.equal(field1.fillColor, color.green)==true) field1.fillColor = color.red;  
else field1.fillColor = color.green; 

判斷A欄位值的不同而後自動填入B欄(自動填入B欄位的值,需判斷A欄位值的不同而不同)
Basically If Field A is ProductA  Field B=10
If Field A is ProductB then Field B =15
If Field A is ProductC then Field B = 20
You can use this code as the custom calculation script for "Field B":
=========
var fieldA = this.getField("Field A").valueAsString;
if (fieldA=="ProductA") event.value = 10;
else if (fieldA=="ProductB") event.value = 15;
else if (fieldA=="ProductC") event.value = 20;
else event.value = "";

檢查必填欄位
var emptyFields = [];
for (var i=0; i     var f= this.getField(this.getNthFieldName(i));
     if (f.type!="button" && f.required ) {
          if (f.valueAsString==f.defaultValue)
               emptyFields.push(f.name);
     }
}
if (emptyFields.length>0) {
     app.alert("Error! You must fill in the following fields:\n" + emptyFields.join("\n"));
}



Acrobat官方手冊

2017年6月20日 星期二

Outlook表單不能開啟執行 outlook customer form won't open

2017年6月13日Outlook安全性更新後可能會發生下列問題:

  1. 附件不會打開
  2. iCloud不工作
  3. 自定義表單(customer form)不起作用。(我是遇到這個)

當我開啟outlook自定義表單會出現下列對話框:
「在執行中為了防止危險的代碼,此表單將不會載入中一個或多個物件。
若需詳細資訊,請連絡管理員。」

原因是因為下列windows update所導至,所以如出現和我一樣的狀況,請移除以下的KB即可恢復正常。

Description of the security update for Outlook 2007: June 13, 2017 (KB3191898)
The complete list of KB article for all Office applications is at June 13, 2017, update for Microsoft Office

參考Slipstick網內容https://www.slipstick.com/outlook/updates/outlooks-june-13-2017-security-update/

Custom Forms won’t open

Users are complaining about published custom forms too. VBScript and some controls are blocked.
I have a custom form that's published to my personal forms library that I use for new contacts. When I create a contact, I get the following message and the VBScript behind the form doesn’t run. If I uninstall the security update the problem goes away.
"To help prevent malicious code from running, one or more objects in this form were not loaded. For more information, contact your administrator."


2017年5月24日 星期三

當由exchange 2016信箱發信,其類別會被清除(exchange 2007之後都會發生) Message Categories Are Lost When You Send Messages from an Exchange 2007 Mailbox

Message Categories Are Lost When You Send Messages from an Exchange 2016 Mailbox

當由exchange 2016信箱發信,發現其類別會被清除(exchange 2007之後都會發生) 。

因為exchange預設是會將類別清除,所以將其設為false即可

可利用Get-TransportConfig查看ClearCategories的狀態是什麼,未下指令前應該為true。

指令:
To use the Exchange Management Shell to disable clearing categories from messages sent
Run the following command:

Set-TransportConfig -ClearCategories $False

官網資訊

https://technet.microsoft.com/en-us/library/cc308574(v=exchg.80).aspx

https://technet.microsoft.com/zh-tw/library/bb124151%28v=exchg.160%29.aspx?f=255&MSPPError=-2147217396

2017年4月7日 星期五

如何防止outlook 2010email中的網頁圖檔(internet image)在轉寄時被內嵌至本文中。

至https://www.howto-outlook.com/faq/imagesignature.htm
截錄

How can I prevent an Internet image from being embedded in the message?

After creating a signature with a link to an Internet image, you might experience that the image still gets embedded in the message itself.
Outlook has an option to control to what should happen with linked images; they can either stay linked or Outlook can embed them in the message upon sending.
In Outlook 2003 you can find the option under;
Tools-> Options…-> tab Mail Format-> button Internet Format-> disable the option:
"When an HTML message contains pictures located on the Internet, send a copy of the pictures instead of the reference to the location."
In Outlook 2007 and Outlook 2010, this option can only be modified via the Registry;
Key Outlook 2007:
HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Options\Mail
Key Outlook 2010:
HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Options\Mail
Value name; Send Pictures With Document
Value: 0
With a value of 1 or if the value name is missing, you’ll include the picture with the message instead of as a link.
If the value is set to 0 you’ll send a link.
Note: The value name contains spaces and capital letters; you must include these as well.

2017年3月8日 星期三

批次修改AD上的用戶密碼 (利用指令一次改多個AD user password)

如果要一次大量更改設定AD user密碼,可以使用下列方法一次設定。

需設定一個text file 命名為 set_password.csv,內容只有帳號,密碼
例如:
user_a,Vx22503
user_b,password2

另設一個text file命名為batchsetpassword.cmd,內容如下:

  • 要注意黃色標示處的路徑位置及檔案名稱,如果不對是不會成功的。
  • 以這個列子來說請將兩個檔案都放到AD server D:\中,run cmd(開啟DOS視窗)後keyin batchsetpassword.cmd ENTER就會直執行。


CLS
@ECHO Off
COLOR 70
MODE CON COLS=65 LINES=40
setlocal EnableDelayedExpansion
ECHO ----------------------------------------------------------------
ECHO     正在自動設定密碼....
ECHO ----------------------------------------------------------------
for /F "tokens=1,2 delims=, " %%i in (D:\set_password.csv) do (
set username=%%i&set password=%%j
echo     正在設定 !username! 帳號之密碼為 !password!...
start /wait net user !username! !password! /domain
echo     設定完畢...
echo.
)
pause
exit

以上內容參考下列網址:

http://ithelp.ithome.com.tw/questions/10016008
https://ss64.com/nt/delayedexpansion.html