Showing posts with label Outlook. Show all posts
Showing posts with label Outlook. Show all posts

Wednesday, December 12, 2012

How to: Copy the AutoComplete list to another computer

 
AutoComplete is a feature which displays suggestions for names and e-mail addresses as you begin to type them. These suggestions are possible matches from a list of names and e-mail addresses that you have typed before, known as the AutoComplete name list.
You can copy the names and e-mail addresses in the AutoComplete list from one computer to another. For example, if you are upgrading to a new computer and don't want to lose all the information stored in the AutoComplete list, you can copy the names and e-mail addresses from your old computer to your new computer.
 Important   You must exit Microsoft Outlook before starting the following procedure. The names will be included in the AutoComplete list when you restart Outlook.
  1. On your old computer, choose one of the following:
    • Windows Windows 7 and Vista     Go to drive:\user\AppData\Local\Microsoft\Outlook.
    • Microsoft Windows XP     Go to drive:\Documents and Settings\user\Application Data\Microsoft\Outlook.
 Note   Depending on your file settings, this folder might be hidden.
How do I display hidden folders?
  • Windows 7 and Windows Vista    
    1. Click the Start button, and then click Control Panel.
    2. Click Appearance and Personalization.
 Note   If you are using Control Panel Classic View, double-click Folder Options, and then go to step 4.
  1. Click Folder Options.
  2. On the View tab, under Advanced settings, under Files and Folders, under Hidden files and folders, select Show hidden files and folders.
  • Windows XP    
  1. Click the Start button, and then click Control Panel.
  2. Click Folder Options.
  1. Click the View tab, and then click the Show hidden files and folders option.


  1. Right-click profile name.nk2, and then click Copy.

 Tip   You can copy the file to removable media, such as a floppy disk or a CD, and then copy the file to the correct location on your new computer. Or you can attach the file to an e-mail message and send the message to yourself. On the new computer, open the attachment in Outlook, and then save it to the correct location.
  1. On the computer where you want to populate the AutoComplete list, choose one of the following:
    • Windows 7 and Windows Vista     Right-click anywhere in drive:\user\AppData\Local\Microsoft\Outlook and then click Paste to save profile name.nk2.
    • Microsoft Windows XP     Right-click anywhere in drive:\Documents and Settings\user\Application Data\Microsoft\Outlook and then click Paste to save profile name.nk2.
  2. If the Outlook user profile name is different on the computer where you are moving the .nk2 file, you must rename the file with the Outlook user profile name that is being used on the new computer, after you copy the file to the correct folder. For example, if you move Kim Akers.nk2 from the original computer with an Outlook user profile name of Kim Akers, and you copy the Kim Akers.nk2 file to the new computer, you must rename the file with the Outlook profile name that is being used on the new computer.
  3. When prompted about replacing the existing file, click Yes.
  4. Open Outlook to view the changes to the AutoComplete list.

Wednesday, March 14, 2012

Thủ thuật đơn giản để thu hồi Email đã gửi

ôi khi sau khi nhấn gửi thư điện tử thì bạn mới nhận thấy có sự nhầm lẫn. Bạn lo lắng vì người nhận rất có thể sẽ hiểu lầm dụng ý trong e-mail. Trong trường hợp này, bạn hãy sử dụng 2 thủ thuật hữu ích dưới đây để thu hồi lại những e-mail này nhé.
Bạn đọc có thể sử dụng phần mềm MS Outlook được tích hợp sẵn trong bộ phần mềm Microsoft Office. Ứng dụng này cung cấp tính năng Recall sẽ cho phép bạn “gọi” lại những email đã được gửi đi.
Để sử dụng chức năng này, bạn truy cập chức năng Sent Items và mở cửa sổ Message mà bạn muốn gửi lại, sau đó bấm nút Office (File Menu), rồi di chuyển xuống tab Info và lựa chọn mục Message Resend and Recall.
4d43ecd6 9301 47e4 9fac e8ae566ea311 Thủ thuật đơn giản để “thu hồi” e mail đã gửi
Kích chuột vào nút Resend or Recall rồi chọn chức năng Recall This Message trong menu sổ xuống. Tiếp theo bạn chọn Delete unread copies of the message để xóa bản sao của tin nhắn chưa đọc hoặc Delete unread copies and replace with a new message để xóa các bản sao chưa đọc và thay thế bằng một tin nhắn mới.
84e4dd39 485b 4bcc 8d19 66e2afff8be5 Thủ thuật đơn giản để “thu hồi” e mail đã gửi
Sau đó bạn chọn Tell me if recall succeeds or fails for each recipient để chương trình thông báo cho bạn biết nếu gọi lại tin nhắn thành công hay không. Sau khi chọn xong, bạn bấm nút OK để áp dụng.
Ngoài ra có một tính năng mà nhiều người sử dụng Gmail nên biết đó là “Undo Send“.
Để sử dụng tính năng này bạn phải đăng nhập vào tài khoản Gmail của mình và vào thẻ thẻ Settings, sau đó bạn khởi động chức năng “Undo Send” trong Gmail Labs bằng cách chọn Enable.
da7ec1a2 8bca 4c0b b914 2ae710d9b943 Thủ thuật đơn giản để “thu hồi” e mail đã gửi
Ngay khi kích hoạt tính năng này, tùy chọn “Undo” sẽ xuất hiện sau khi người dùng nhấp chuột gửi thư. Mặc dù vậy, người dùng chỉ có 5 giây để click vào nút “hủy” lệnh trước đó để thu hồi lại e-mail đã gửi. Sau khoảng thời gian đó, việc thu hồi thư điện tử trong Gmail sẽ không thể thực hiện được.
eb5ae236 1cc2 4455 acfd 8fae227ed5ef Thủ thuật đơn giản để “thu hồi” e mail đã gửi

Sử dụng Outlook hiệu quả

Các công ty dù lớn hay nhỏ đều dựa khá nhiều vào dữ liệu Word, bảng tính Excel và trình chiếu PowerPoint để hoàn thành công việc hàng ngày. Về mặt nào đó, Outlook có đôi chút kém lợi thế hơn so với 3 người “anh em” của mình mới nêu trên. Tuy nhiên, phần quan trọng thực sự trong bộ ứng dụng văn phòng phổ biến của Microsoft lại là email, quản lý liên lạc, lên lịch các tác vụ.
6 mẹo dành cho Outlook 2010, 2007 và 2003 dưới đây sẽ giúp bạn dành ít thời gian hơn khi mở email message, ghi nhớ về các nhắc nhở, kéo các file và gửi chúng như bản đính kèm, thêm từ để kiểm tra chính tả, xóa khoảng trống trên thanh tác vụ và cải thiện danh sách phím tắt giúp tiết kiệm thời gian khi sử dụng Outlook.
Lưu trữ một folder message theo lịch
Rất nhiều người không cần phải lưu trữ email trên Outlook và chọn xóa các message cũ hay đơn giản hơn là để kệ chúng làm đầy hòm thư. Tuy nhiên, hầu hết các công ty đều giới hạn kích cỡ cho mỗi tài khoản Outlook cá nhân. Vậy nên, bạn có thể nhận được một thông báo từ nhân viên IT để lưu trữ một số email cũ.
Lưu trữ có thể giúp folder không bị làm đầy, nhưng khi truy hồi message đã được lưu trữ sẽ mất nhiều thời gian hơn so với các message chưa được lưu trữ. Đôi khi, người dùng có thể cần phải truy cập vào message cũ hơn so với thời gian tự động lưu trữ mặc định của Outlook là 6 tháng. Bạn cũng có thể dừng tất cả các hoạt động lưu trữ của Outlook hoặc để phần mềm này chỉ lưu trữ một số folder và message cụ thể.
Chú ý: Tính năng Clean Up của Outlook 2010 tự động gỡ bỏ những gì phần mềm này nhận diện là message thừa trong một folder nào đó. Điều này không giống với tính năng lưu trữ email cũ.
Để kích hoạt tính năng tự động lưu trữ cho email ở một folder nào đó, phải chuột vào folder và chọn Properties → AutoArchive. Theo mặc định, tính năng lưu trữ sẽ chạy 14 ngày và áp dụng với các message cũ hơn 6 tháng tính tại thời điểm thực hiện. Để thay đổi cài đặt mặc định, chọn nút Default Archive Settings để mở hộp thoại AutoArchive. Tại đây, bạn có thể thay đổi tần suất lưu trữ, thời gian giữ các message chưa được lưu trữ và địa điểm lưu file archive.pst.
2e7893e9 ba45 4df9 8c5e 6734e749c3da Sử dụng Outlook hiệu quả
Điều chỉnh cài đặt tự động lưu trữ để chỉnh sửa tần suất lưu trữ, nơi lưu trữ và các lựa chọn khác.
Để tùy biến cài đặt lưu trữ của một folder, phải chuột vào folder đó và chọn Properties → AutoArchive, chọn "Archive this folder using these settings" và đưa ra lựa chọn. Để ngăn không cho một message cá nhân nào đó khỏi việc lưu trữ, mở nó ra và kích vào File → Info → Properties trong Outlook 2010 và 2007 hoặc File → Properties trong Outlook 2003. Tích vào mục "Do not AutoArchive this item".
Tạo nhắc nhở mang nhiều thông tin hơn
Outlook cho phép người dùng gán một message nào đó bằng một danh mục màu hoặc đánh dấu chúng bằng lá cờ. Ngay cả khi có sự hỗ trợ từ những dấu hiệu này, bạn vẫn cần hỗ trợ để nhớ các message quan trọng. Để thêm một miêu tả xuất hiện ngay bên cạnh lá cờ khi bạn mở message, chọn Follow Up → Custom và điền từ hoặc cụm từ giải thích.
Để thêm một nhắc nhở xuất hiện ngay trong các tác vụ và lịch làm việc, phải chuột vào message và chọn Follow Up → Add Reminder. Trong mục "Flag to", thêm miêu tả cho hành động tương ứng. Đoạn chữ này sẽ xuất hiện ở trên cùng của message cùng với các thông tin khác.
fd32902b 1d13 4069 9ecc 5a85965d45a8 Sử dụng Outlook hiệu quả
Thêm một miêu tả cho nhắc nhở sẽ xuất hiện ở trên cùng của message để nhắc nhở bản thân về lý do của một tác vụ hay nhắc nhở nào đó.
Cách gửi file đính kèm nhanh chóng
Phương pháp điển hình để đính kèm một file lên email là mở một message mới, chọn icon hình kẹp giấy và điều hướng tới file cần đính kèm ở cửa sổ xuất hiện sau đó. Nếu bạn đang trong Windows Explorer hoặc bất kì cửa sổ folder nào, có thể phải chuột vào file và chọn Send to → Mail recipient. Một cửa sổ tạo message mới sẽ xuất hiện cùng với phần mềm email mặc định của bạn.
Người dùng có thể tiết kiệm nhiều thời gian hơn bằng cách kéo file trực tiếp vào hòm thư Outlook của bạn, giống như mở một message mới với file tự động đính kèm.
Tùy biến kiểm tra chính tả trong Outlook
Lỗi chính tả thể hiện sự không chuyên nghiệp, khiến tính năng kiểm tra chính tả của Outlook trở nên không thể thiếu với bất kì ai. Không có từ điển kiểm tra chính tả nào có thể bao gồm hết những từ mà bạn muốn sử dụng trong công việc hàng ngày. Người dùng có thể giúp tính năng kiểm tra chính tả của Outlook được chính xác hơn bằng cách thêm tên và thuật ngữ bạn thường xuyên sử dụng. Trong Outlook 2010 và 2007, chọn File → Options → Mail → Spelling and Autocorrect → Custom Dictionaries → Edit Word List. Thêm thuật ngữ mới của bạn tại đây và kích OK 2 lần.
Trong Outlook 2003, kích Tools → Options → Spelling và chọn nút Edit ở dưới "Edit custom dictionary". Kích qua tiếp qua các cảnh báo, nếu cần, thêm thuật ngữ mới vào file Custom.dic. Tiếp đến, kích File → SaveFile → Exit. Mẹo này không giúp bạn tiết kiệm thời gian nhưng có thể giúp văn bản/email trông đẹp hơn.
Microsoft cung cấp thêm thông tin về tùy biến từ điển trong Outlook và các ứng dụng Office 2010 trên trang Office Support.
Thu nhỏ Outlook vào khu vực thông báo.
4692f854 569a 4fd3 b4ee c7280a21ecd4 Sử dụng Outlook hiệu quả
Kích Outlook hiển thị từ thanh tác vụ khi phần mềm này được thu nhỏ bằng cách chọn Hide When Minimized sau khi phải chuột vào icon của Outlook trong khu vực thông báo.
Trải qua một khoảng thời gian sử dụng, thanh tác vụ của bạn sẽ bị làm đầy bởi những ứng dụng đã được thu nhỏ, ngay cả khi bạn chọn nhóm nhiều cửa sổ đang mở lại với nhau. (Để thiết lập như vậy, phải chuột vào thanh tác vụ, chọn Properties → Taskbar, và chọn "Always combine, hide labels" trong menu cạnh "Taskbar buttons").
Người dùng có thể cho Outlook ra khỏi thanh tác vụ bằng cách đặt một icon thu nhỏ trong khu vực thông báo. Để thực hiện việc này, phải chuột vào icon Outlook trong khu vực thông báo và chọn Hide When Minimized. Outlook sau đó sẽ chỉ thu nhỏ vào khu vực thông báo chứ không vào thanh tác vụ nữa.
Chuyển nhanh chóng sang ứng dụng văn phòng khác
Nếu bạn đã mở một ứng dụng văn phòng, có thể sau đó bạn cũng muốn làm việc thêm với ứng dụng khác. Bạn có thể mở thêm dữ liệu Word mới, bảng tính Excel, trình chiếu PowerPoint hoặc các loại file khác trong Outlook bằng cách nhấn phím tắt Ctrl+Shift+H. Phím tắt này sẽ mở hộp thoại New Microsoft Office Document. Chỉ cần chọn loại file mình cần và kích OK.
Trang Microsoft Office liệt kê một danh sách các phím tắt dành cho Outlook 2010, Outlook 2007, và Outlook 2003. Dưới đây là phím tắt dành cho email:
- Chuyển sang Inbox: Ctrl + Shift + I
- Chuyển sang Outbox: Ctrl + Shift + O
- Chọn tài khoản để gửi email đi: Ctrl+Tab (tập trung vào dòng To), sau đó chuyển tới nút Accounts
- Gửi: Alt + S
- Trả lời một message: Ctrl + R
- Trả lời tất cả cho một message: Ctrl + Shift + R
- Đánh dấu một message không phải là junk mail: Ctrl + Alt + J
- Hiển thị nội dung bị chặn (trong một message): Ctrl + Shift + I
- Đăng tải lên một folder: Ctrl + Shift + S
- Kiểm tra email mới: Ctrl + M hoặc F9
- Chuyển tới message kế tiếp: Mũi tên lên
- Chuyển về message trước đó: Mũi tên xuống
- Chuyển lên hàng trên: Alt + mũi tên lên
- Chuyển xuống hàng dưới: Alt + mũi tên xuống
- Tạo một message mới: Ctrl + N
- Mở một message mới nhận được: Ctrl + O
- Chuyển đổi message HTML hoặc RTF sang văn bản thuần: Ctrl + Shift + O
- Thêm một Quick Flag vào một message: Insert
- Hiển thị Flag cho hộp thoại Follow Up: Ctrl + Shift + G
- Đánh dấu đã đọc: Ctrl + Q
- Hiển thị menu download ảnh, thay đổi cài đặt download hoặc thêm người gửi vào danh sách Safe Senders List: Ctrl + Shift + W.

10 thủ thuật hay trong Excel và Outlook 2007

Dưới đây là những thủ thuật hữu ích khi bạn sử dụng Excel và Outlook 2007:
1/ Tùy chỉnh Quick Acess Toolbar (với các ứng dụng khác trong bộ Office 2007 cũng làm tương tự): Quick Acess Toolbar là một thanh công cụ nhỏ ở bên cạnh Office Button, thanh công cụ này rất hữu dụng nhưng ít ai dùng tới nó vì quá nhỏ, ít công cụ lại quá xa vùng soạn thảo. Thủ thuật này sẽ làm cho nó hữu dụng hơn.
a9331b5a 2350 4fdb 9962 4be58a434f8a 10 thủ thuật dùng trong Excel và Outlook 2007

- Đầu tiên bạn hãy bấm vào nút mũi tên bên cạnh Quick Access Toolbar rồi chọn More Commands.
- Trong cửa sổ Excel Options mới xuất hiện, tại combo box Choose Comand from bạn chọn All Command để thấy toàn bộ các nút lệnh, chọn một cái vừa ý ở khung bên trái rồi bấm nút Add để bổ sung thêm vào Quick Access Toolbar. Còn để xóa bớt một nút tại Quick Access Toolbar thì bạn chọn tại khung bên phải rồi bấm nút Remove. Sau khi làm xong bạn bấm OK là sẽ được một thanh công cụ với đầy đủ các chức năng cần thiết sẵn sàng để sử dụng.
- Tuy nhiên, để nó được gần vùng soạn thảo hơn thì bạn hãy bấm vào nút mũi tên bên cạnh Quick Access Toolbar rồi chọn Show below the Ribbon. Và bạn sẽ có một thanh công cụ y hệt trong các phiên bản Office trước.

2/ Làm một dòng (cột) luôn xuất hiện trên các dòng (cột) khác: giả sử trong danh sách bạn tạo một dòng đề mục có nội dung là Số thứ tự, Tên hàng, Mã hàng… và lần lượt nhập nội dung vào các cột tương ứng. Nếu danh sách này quá dài và khi bạn kéo xuống dòng 10, 11… thì dòng đề mục sẽ biến mất và mỗi khi bạn cần tra cứu dòng đề mục này lại phải kéo danh sách lên rất tốn thời gian. Thủ thuật này sẽ giúp bạn.
- Bạn bấm chọn toàn bộ dòng hoặc cột cần được luôn xuất hiện rồi chuyển qua Ribbon View, bạn bấm vào nút Freeze Panes và chọn một trong các mục:
+ Freeze Panes: làm cho dòng, cột bạn chọn luôn xuất hiện dù bạn kéo bản tính đến đâu, với lựa chọn này bạn cần phải chọn chính xác dòng hoặc cột.
+ Freeze Top Row: làm cho dòng cao nhất trong bản tính luôn xuất hiện
+ Freeze Firtst Column: làm cho cột đầu tiên trong bản tính luôn xuất hiện
ab050f8b 8035 4c39 8e68 a17158bac8f9 10 thủ thuật dùng trong Excel và Outlook 2007

3/ In cả đường kẻ trong bảng tính Excel: thông thường, khi bạn in một bảo tính Excel ra giấy thì chỉ thấy các giá trị có trong ô mà không hề thấy đường kẻ đâu cả, muốn thấy đường kẻ bạn buộc phải chọn màu cho nó. Nếu muốn mặc định luôn in ra đường kẻ thì bạn làm theo cách sau:
- Chuyển qua Ribbon Page Layout và vào bấm vào nút Page Setup Dialog Box Launcher (nút mũi tên rất nhỏ bên phải chữ Page Setup).
- Trong cửa sổ Page Setup hiện ra bạn chuyển qua thẻ Sheet, tại mục Print bạn đánh dấu chọn vào Gridlines rồi bấm OK.
- Cũng có một cách đơn giản hơn, đó là tại thẻ Page Layout, tại phần Gridlines của mục Sheet Options bạn đánh dấu chọn chữ tại Print.
4/ Lưu bảng tính thành file PDF: để làm được việc này, bạn chỉ cần tải thêm một add-in hỗ trợ tại trang Web http://r.office.microsoft.com/r/rlidMSAddinPDFXPS (934 KB). Sau khi tải về và cài đặt, khi bạn lưu lại một bảng tính, tại mục Save as type sẽ có thêm định dạng PDF.
Thủ thuật Microsoft Outlook 2007:
5/ Mở nhanh các tập tin đính kèm bằng phím tắt: với các bức thư được đính kèm nhiều tập tin, nhất là tập tin hình ảnh, để xem thử bạn phải nhấp chuột vào rất mất công. Thay vì vậy, bạn hãy nhấn phím tắt Shift + Tab, sau đó dùng các nút mũi tên để di chuyển vệt sáng đến tập tin cần xem rồi bấm Enter, trong hộp thoại cảnh báo hiện ra bạn chọn Open để mở hoặc Save để tải tập tin đính kèm này về.

6/ Tự động xóa các thư quá cũ: chức ăn AutoArchive của Outlook 2007 sẽ tự động giúp bạn xóa các thư quá cũ trong một khoảng thời gian nhất định. Nhờ thế, bạn sẽ ít tốn dung lượng ổ cứng hơn và cũng đỡ rối khi tìm kiếm lại thư. Để bật chức năng này, tại giao diện chính của Outlook 2007, bạn vào menu Tools > Options. Trong cửa sổ hiện ra bạn chuyển qua thẻ Orther và bấm vào nút AutoArchive, trong cửa sổ hiện ra bạn có những thiết lập sau:
- Run AutoArchive every: bạn đánh dấu chọn vào mục này và chọn số ngày để AutoArchive tự động chạy, ví dụ ở hình minh họa là mỗi 20 ngày.
- Prompt before AutoArchive runs: đánh dấu chọn nếu bạn muốn thấy thông báo trước khi AutoArchive chạy.
- Delete expired items, Archive or delete old items, Show archive folder in list: bạn đánh dấu chọn vào tất cả các lựa chọn này để AutoArchive xóa toàn bộ thư và thư mục quá cũ.
- Clean out items than: bạn chọn khoảng thời gian mà những thư lâu hơn khoảng thời gian này sẽ bị xóa. Như hình minh họa là thư nào cũ hơn 6 tháng sẽ bị xóa.
- Move old items to: nếu bạn muốn các thư này không xóa hẳn mà được chuyển vào một thư mục nào đó để sử dụng sau thì bạn đánh dấu vào mục này và bấm nút Browse để chọn thư mục.
- Permanently delete old items: chọn lựa chọn này nếu muốn xóa hẳn các thư.
Cuối cùng bạn bấm OK để lưu lại các thiết lập.
7/ Tự động thay đổi kích thước của ảnh đính kèm khi gửi thư: việc này rất hữu dụng khi bạn muốn gửi nhiều ảnh kích thước và dung lượng lớn nhưng lại không muốn tuốn thời gian để chuyển đổi nó. Với chức năng này, Outlook sẽ làm thay cho bạn ngay lúc gửi thư.
- Đầu tiên bạn bạn đính kèm trước các bức ảnh vào thư sắp gửi, sau khi đã đính kèm xong, bạn chuyển sang Ribbon Insert, bấm vào nút Include Dialog Box Launcher (biểu tượng mũi tên rất nhỏ bên phải chữ Include), sau đó tại khung Attachment Options mới xuất hiện ở bên phải giao diện, bạn đánh dấu vào Regular attachments và tại phần Select picture size bạn chọn kích thước muốn ảnh thay đổi. Bạn cũng nhớ đánh dấu vào Show when attaching files để khung này luôn xuất hiện khi bạn đính kèm thư.
8/ Tìm kiếm thư cực nhanh với chức năng Instant Search: đây là chức năng mới được bổ sung ở phiên bản Outlook 2007 này, bạn có thể tìm kiếm thư một cách nhanh nhất bằng các cú pháp tương tự trong các hộp thư của Gmail, kết quả sẽ hiển thị gần như ngay lập tức.
- Nếu bạn dùng Windows Vista, chức năng Instant Search sẽ mặc định được bật, bạn có thể thấy khung tìm kiếm nhanh Instant Search ngay bên dưới chữ Inbox tại giao diện chính, bạn nhập từ khóa và và bấm Enter là kết quả sẽ được hiển thị ngay. Nếu bạn dùng Windows XP, bạn cần phải cài thêm Windows Desktop Search – chương trình tìm kiếm trên desktop của Microsoft (Outlook sẽ đòi hỏi chương trình này khi khởi động, bạn có thể tự tải bằng cách vào http://www.microsoft.com/windows/desktopsearch/default.mspx, dung lượng 4.65 MB). Sau khi đã cài đặt, bạn hãy bấm vào dòng Click here to enable Instant Search ngay bên dưới khung tìm kiếm để kích hoạt Instant Search.
3c0f5040 2bcd 4d94 9286 52bab65e615b 10 thủ thuật dùng trong Excel và Outlook 2007


9/ Khắc phục hiện tượng Instant Search chậm chạp: sau thời gian dài, hộp thư của bạn sẽ có dung lượng khá lớn, các tập tin *.pst lưu trữ thư của Outlook sẽ lớn dần lên, bạn sẽ thấy Instant Search sẽ hoạt động khá ì ạch, bạn chỉ cần tải và cài đặt bản cập nhật cho Outlook 2007 (dung lượng 8.3 MB) tại http://www.microsoft.com/downloads/details.aspx?familyid=C262BCFD-1E09-49B6-9003-C4C47539DF66&displaylang=en. Tải về và chạy nó, Instant Seach sẽ hoạt động nhanh như bình thường.
10/ Sao lưu toàn bộ cho Outlook: bạn có thể dễ dàng sao lưu thư, sổ địa chỉ: cho Outlook bằng cách sao chép toàn bộ tập tin và thư mục có trong đường dẫn C:\Documents and Settings\\Local Settings\Application Data\Microsoft\Outlook (đới với Windows XP) hoặc C:\Users\\AppData\Local\Microsoft\Outlook (đối với Vista). Khi cần phục hồi, bạn chỉ cần chép đè các tập tin đã sao lưu vào vị trí cũ.

Friday, March 9, 2012

Copy folder structure

I want to start off with a new empty pst-file (my current one gets too big to manage) but I’d like to keep the folder structure for my new pst-file.
Is there any way I can recreate that automatically?
While it is not a direct feature of Outlook, we can use Outlook’s Archive feature to achieve this.
  1. Start a manual archive process;
    • Outlook 2007 and previous
      File-> Archive…
    • Outlook 2010
      File-> section Info-> Archive Tools-> Archive…
  2. Select the root of the folder set that you would like to mimic.
    If you would only like to mimic the subfolders of the Inbox folder, then you can leave the selection on the Inbox folder.
  3. Set the “Archive items older than” field to a date so far in the past that you are certain no emails will get moved.
  4. Set the location of your Archive file to the location where you like to store your pst-files. For instance;
    D:\Documents\>\Outlook\mymail.pst
  5. Press OK to execute Archive
When Archive is done, only empty folders should be created in the new pst-file.
To set it as your new delivery location use;
  • Outlook 2002/XP, Outlook 2003 and Outlook 2007
    File-> Data File Management…
  • Outlook 2010
    File-> section Info-> button Account Settings-> Account Settings-> tab Data Files
To rename the default name “Archive” of the folder set to something else;
Right click the root of the folder set and choose Properties-> button Advanced…-> tab Advanced…-> field: Name
Note: When you are in a corporate environment, it could be that the Archive feature has been disabled as a company policy. You’d then can create a copy of the original pst-file and use Advanced Find in Outlook to display all items in a single view. From here you can SHIFT+DELETE all the items (probably only a couple of hundred at a time). After that, make sure you compact the pst-file. This might not be as fast as the above method, but it might still be faster than recreating a large folder structure.

Applying custom views to all folders at once

I have made changes to my Inbox view but also want to have these changes in all my other folders. Do I have to change them one by one?
No, there is no need to do that. In Outlook you can define view templates to to easily apply changes to multiple folders at once. Outlook 2010 also has a separate feature to copy the current view of a folder to other folders.

Defining views

Depending on your version of Outlook you can access your defined view templates in the following way;
  • Outlook 2002/XP and previous
    View-> Current View-> Define Views…
  • Outlook 2003
    View-> Arrange By-> Current View-> Define Views…
  • Outlook 2007
    View-> Current View-> Define Views…
  • Outlook 2010
    tab View-> button Change View-> Manage Views…
Custom View Organizer in Outlook 2007 (click on image to enlarge)
Manage custom views dialog in Outlook 2007.
(click on image to enlarge)

Default Messages view

By default all folders and newly created folders are in the "Messages" view (except for the Sent Items folder which is in the "Sent To" view). If you make changes to this view, it will automatically also apply these changes to all the folders that are still in the default "Messages" view.
If the view of some folders have already been altered, then making changes to the default “Messages” view will not alter the view of these folders. If you are using Outlook 2010, then you can use the "Apply Current View to Other Mail Folders" feature. For previous versions of Outlook, you can reset your views first or create a custom view template and apply it on first use of that folder. See further below for details.

Outlook 2010: Copy view to other folders

Outlook 2010 has a feature called "Apply Current View to Other Mail Folders" which allows you to copy the view of a folder to another folder without needing to make a view template first.
You can access this feature via;
tab View-> button Change View-> Apply Current View to Other Mail Folders…
Apply Current View to Other Mail Folders feature in Outlook 2010
Copying a view has been made easy in Outlook 2010.
Note: The feature automatically hides special folders such as Sent Items, Draft and Junk E-mail. This is because these folders have special views of their own.

Reset all views first

It might be that you’ve already modified the view for some individual folders. This could be even something simple as modifying the column size. In these cases you will find that changes to the default "Messages" view will not apply to these folders. To prevent this from happening you can force a reset on all the folders by starting Outlook with the /cleanviews switch;
  • Windows XP
    Start-> Run; outlook.exe /cleanviews
  • Windows Vista and Windows 7
    Start-> type; outlook.exe /cleanviews
Note: There is a space between outlook.exe and /cleanviews
This will reset all defined views back to default, clears custom views and will apply the default views to all folders (Inbox, subfolders, Sent Items, Contacts, Calendar, Notes, Tasks and Journal).
If you have many custom views already which you want to keep, you probably don’t want to do this. In this case you can define a new view and simply apply that view on first use of a folder. This is less cumbersome than defining the view per folder.
Starting Outlook with the /cleanviews switch on Windows 7.
Starting Outlook with the /cleanviews switch on Windows 7.

Extra Tip

When you enable the "Advanced Toolbar" via View-> Toolbars-> Advanced you can very quickly (2 clicks) change a view on a folder. (This does not apply to Outlook 2010).

Microsoft Outlook 2007 Managing Email with Folders

If you have a large quantity of messages or messages related to various projects that you want to keep together for easy reference, you may want to use folders to organize them.

return to topCreating a New Folder

Outlook allows you to create a new folder and then manually move items in and out of that folder.
  1. From the File menu, select New » Folder...
    OR
    Right click your Inbox » select New Folder...
    The Create New Folder dialog box appears.
    Create New Folder dialog box
  2. In the Name text box, type a name for the folder
  3. In the Select where to place the folder scroll box, select a folder in which your new folder will be located
    NOTE: It is a good idea to use the Inbox as the parent folder to keep your email together in one location (as opposed to keeping an email folder with your Contacts or Calendar, for example).
  4. Click OK
    The new folder is created and appears in your Folder list.

return to topSelecting Multiple Messages

To save time while transferring a group of messages, you can select the whole group at once, rather than one at a time.

Selecting Contiguous Messages

  1. Click to select the first message
  2. Hold down the [Shift] key
  3. Click to select the last message of the group
  4. Release the [Shift] key
    The first, last, and all messages in between are selected and can be modified as a whole.

Selecting Non-contiguous Messages

  1. Click to select the first message
  2. Hold down the [Ctrl] key
  3. Click to select the next message
  4. Repeat step 3 until all the messages are selected
  5. Release the [Ctrl] key
    The selected messages can now be modified as a whole.

return to topMoving Messages to Folders

When you transfer your messages to a folder, you may move them to a new folder created specially for a certain group or to an existing folder.

Moving Messages to a New Folder

The following steps will allow you to transfer the message and create a new folder at the same time. There is no need to create a new folder prior to this process.
  1. Select the message(s) to be transferred
    HINT: You can select and transfer multiple messages at once. For more information, refer to Selecting Multiple Messages.
  2. From the Edit menu, select Move to Folder...
    OR
    Right click the message » select Move to Folder...
    The Move Items dialog box appears.
  3. Select the parent folder in which the new folder will be located
    NOTE: It is a good idea to use the Inbox as the parent folder to keep your email together in one location.
  4. Click NEW...
    The Create New Folder dialog box appears.
  5. In the Name text box, type the folder name
  6. Click OK
    The new folder is created and appears selected in the Move Items dialog box.
  7. Click OK
    The message(s) is moved.

Moving Messages to an Existing Folder: Menu Option

  1. Select the message(s) to be transferred
    HINT: You can select and transfer multiple messages at once. For more information, refer to Selecting Multiple Messages.
  2. From the Edit menu, select Move to Folder...
    OR
    Right click the message » select Move to Folder...
    The Move Items dialog box appears.
  3. Select the desired folder
  4. Click OK

Moving Messages to an Existing Folder: Drag and Drop Option

  1. In the Navigation pane, click MAILMail button
  2. In the list of folders, locate the target folder
  3. Click and drag the message(s) to the target folder
    HINT: You can select and transfer multiple messages at once. For more information, refer to Selecting Multiple Messages.

Moving Messages to an Existing Folder: Message Option

  1. Open the message to be transferred
  2. From the Message tab, in the Actions group, click MOVE TO FOLDERMove to Folder button» select the desired folder

return to topOpening Folders

You can easily view the contents of your folders.
  1. In the Navigation pane, click MAILMail button
  2. Locate the desired folder
  3. Select the folder
    The contents of the folder are displayed to the right of the Navigation pane.

return to topCreating Favorite Folders

In order to access frequently used folders more quickly, you can add them to the Favorite Folders list.

Creating Favorite Folders: Quick Menu Option

  1. To display Favorite Folders, in the Navigation pane, click MAILMail button
    The Favorite Folders list appears at the top of the Navigation pane.
    Favorite Folders in the Mail panel
  2. Within the Mail Folders list, locate the desired folder
  3. Right click the desired folder » select Add to Favorite Folders
    The folder is added to Favorite Folders.

Creating Favorite Folders: Drag and Drop Option

  1. To display Favorite Folders, in the Navigation pane, click MAILMail button
    The Favorite Folders list appears at the top of the Navigation pane.
    Favorite Folders in the Mail panel
  2. Within the Mail Folders list, locate the desired folder
  3. Click and drag the folder to the Favorite Folders list
    The folder is added to Favorite Folders.

return to topRemoving Folders from Favorite Folders

  1. To display Favorite Folders, in the Navigation pane, click MAILMail button
    The Favorite Folders list appears at the top of the Navigation pane.
    Favorite Folders in the Mail panel
  2. In the Favorite Folders list, right click the desired folder » select Remove from Favorite Folders
    The folder is removed from Favorite Folders.

Thursday, January 19, 2012

Get Attachment file, read XML on Outlook VBA

Function GetAttachments()
   

Dim ns As NameSpace
 Dim Inbox As MAPIFolder
 Dim Item As Object
 Dim Atmt As Attachment
 Dim FileName As String
 Dim i As Integer


 Set ns = GetNamespace("MAPI")
 Set Inbox = ns.Folders("NDucanh@agilitylogistics.com").Folders("Inbox")
 ''ns.GetDefaultFolder(olFolderInbox)
 i = 0
 If Inbox.Items.Count = 0 Then
    MsgBox "There are no messages in the Inbox.", vbInformation, _
           "Nothing Found"
    Exit Function
 End If


  For Each Item In Inbox.Items
 
    For Each Atmt In Item.Attachments
    
    If (GetExtName(Atmt.FileName) = "msg") Then
       FileName = "C:\ATT\" & Atmt.FileName
       Atmt.SaveAsFile FileName
       i = i + 1
    End If
    Next Atmt
    Next Item


GetAttachments_exit:
   Set Atmt = Nothing
   Set Item = Nothing
   Set ns = Nothing
   Exit Function
On Error GoTo GetAttachments_err
GetAttachments_err:
   MsgBox "An unexpected error has occurred." _
      & vbCrLf & "Please note and report the following information." _
      & vbCrLf & "Macro Name: GetAttachments" _
      & vbCrLf & "Error Number: " & Err.Number _
      & vbCrLf & "Error Description: " & Err.Description _
      , vbCritical, "Error!"
   Resume GetAttachments_exit
End Function

Function GetExtName(ScanString As String) As String
      
'*******************************************************
'     Retrieves File Extension Name from full
'       directory path

'   File Extension Only
'          

'   Public
'     FullPath:
'           Full Filepath incl. Filename
'              

'    If GetExtName("c:\autoexec.bat")
'              

'*******************************************************
   
    Dim intPos As String
    Dim intPosSave As String
   
    If InStr(ScanString, ".") = 0 Then
        GetExtName = ""
        Exit Function
    End If
   
    intPos = 1
    Do
        intPos = InStr(intPos, ScanString, ".")
        If intPos = 0 Then
            Exit Do
        Else
            intPos = intPos + 1
            intPosSave = intPos - 1
        End If
    Loop

    GetExtName = Trim$(Mid$(ScanString, intPosSave + 1))

End Function

Sub SaveXML1()
    
    Dim i As Integer
    Dim strFile As String
    i = 1
    Dim OL As Outlook.Application
    Dim Msg As Outlook.MailItem
    
    Set OL = New Outlook.Application
    
    strFile = Dir$("C:\ATT\" & "*.MSG")
    
    Do While strFile <> vbNullString
        
        Set Msg = OL.CreateItemFromTemplate("C:\ATT\" & strFile)
        
         'for all attachments do...
        For Each at In Msg.Attachments
            at.SaveAsFile "C:\ATT\MSG\" & Replace(at.FileName, "." & GetExtName(at.FileName), "") & "-" & CStr(i) & "." & GetExtName(at.FileName)
            i = i + 1
        Next at
        
        Set Msg = Nothing
        strFile = Dir
        
    Loop
    
    Set OL = Nothing
    SaveXML12
    
End Sub

Function SaveXML12()
    
    Dim i As Integer
    Dim strFile As String
    i = 21
    Dim OL As Outlook.Application
    Dim Msg As Outlook.MailItem
    
    Set OL = New Outlook.Application
    
    strFile = Dir$("C:\ATT\MSG\" & "*.MSG")
    
    Do While strFile <> vbNullString
        
        Set Msg = OL.CreateItemFromTemplate("C:\ATT\MSG\" & strFile)
        
         'for all attachments do...
        For Each at In Msg.Attachments
            at.SaveAsFile "C:\ATT\MSG\" & Replace(at.FileName, GetExtName(at.FileName), "") & "-" & CStr(i) & "." & GetExtName(at.FileName)
            i = i + 1
        Next at
        
        Set Msg = Nothing
        strFile = Dir
        
    Loop
    
    Set OL = Nothing
    
End Function


Sub ExportToExcel()

On Error Resume Next
    Kill "C:\ATT\MSG\*.*"
    Kill "C:\ATT\*.*"
    On Error GoTo 0

  On Error GoTo ErrHandler
 
Dim appExcel As Excel.Application
Dim wkb As Excel.Workbook

Dim wks As Excel.Worksheet

Dim rng As Excel.Range

Dim strSheet As String

Dim strPath As String

Dim intRowCounter As Integer

Dim intColumnCounter As Integer

Dim Msg As Outlook.MailItem

Dim nms As Outlook.NameSpace

Dim fld As Outlook.MAPIFolder

Dim itm As Object

    strSheet = "List.xls"
    strPath = "C:\ATT\"

strSheet = strPath & strSheet

Debug.Print strSheet

  'Select export folder

Set nms = Application.GetNamespace("MAPI")

Set fld = nms.PickFolder

  'Handle potential errors with Select Folder dialog box.

If fld Is Nothing Then

MsgBox "There are no mail messages to export", vbOKOnly, "Error"

Exit Sub

ElseIf fld.DefaultItemType <> olMailItem Then

MsgBox "There are no mail messages to export", vbOKOnly, "Error"

Exit Sub

ElseIf fld.Items.Count = 0 Then

MsgBox "There are no mail messages to export", vbOKOnly, "Error"

Exit Sub

End If

  'Open and activate Excel workbook.


Dim i As Integer
i = 0
For Each itm In fld.Items

For Each Atmt In itm.Attachments
    
    If (GetExtName(Atmt.FileName) = "msg") Then
       FileName = "C:\ATT\" & Replace(Atmt.FileName, "." & GetExtName(Atmt.FileName), "") & "-" & CStr(i) & "." & GetExtName(Atmt.FileName)
       Atmt.SaveAsFile FileName
       i = i + 1
    End If
    Next Atmt

Next itm

SaveXML1
ReadXML

Set Msg = Nothing

Set nms = Nothing

Set fld = Nothing

Set itm = Nothing

  Exit Sub

ErrHandler:  If Err.Number = 1004 Then

MsgBox strSheet & " doesn't exist", vbOKOnly, "Error"

Else

MsgBox Err.Number & "; Description: ", vbOKOnly, _
"Error"

End If

Set appExcel = Nothing

Set wkb = Nothing

Set wks = Nothing

Set rng = Nothing

Set Msg = Nothing

Set nms = Nothing

Set fld = Nothing

Set itm = Nothing

End Sub
Function ReadXML()
Dim xml_doc As New DOMDocument
Dim oRoot As MSXML2.IXMLDOMNode
Dim nde_test As IXMLDOMElement
Dim nde_test2 As IXMLDOMElement
Dim oAttributes As MSXML2.IXMLDOMNamedNodeMap
Dim oChildren As MSXML2.IXMLDOMNodeList
Dim strFile As String

Dim appExcel As Excel.Application
Dim wkb As Excel.Workbook

Dim wks As Excel.Worksheet

Dim rng As Excel.Range
Dim strSheet As String

Dim strPath As String

Dim intRowCounter As Integer

Dim intColumnCounter As Integer
strSheet = "List.xls"
strPath = "C:\"
intColumnCounter = 1


intRowCounter = 1
strSheet = strPath & strSheet
    Dim i As Integer
   
    
    Dim OL As Outlook.Application
    Dim Msg As Outlook.MailItem
    
    Set OL = New Outlook.Application
 
   
    Set appExcel = CreateObject("Excel.Application")

appExcel.Workbooks.Open (strSheet)


Set wkb = appExcel.ActiveWorkbook

Set wks = wkb.Sheets(1)

wks.Activate

appExcel.Application.Visible = True
 strFile = Dir$("C:\ATT\MSG\" & "*.xml")
 Do While strFile <> vbNullString
 intColumnCounter = 1
 intRowCounter = intRowCounter + 1
    xml_doc.Load "C:\att\msg\" & strFile
    Dim nNodeList As MSXML2.IXMLDOMNodeList
    Dim nNode As MSXML2.IXMLDOMNode
    Set oRoot = xml_doc.DocumentElement
   
   Set rng = wks.Cells(1, 1)
   rng.Value = "Provider"
   Set rng = wks.Cells(1, 2)
   rng.Value = "SONumber"
   Set rng = wks.Cells(1, 3)
   rng.Value = "Receiptdate"
   Set rng = wks.Cells(1, 4)
   rng.Value = "Receipthr"
   Set rng = wks.Cells(1, 5)
   rng.Value = "NumberOfCartons"
   Set rng = wks.Cells(1, 6)
   rng.Value = "Weight"
   Set rng = wks.Cells(1, 7)
   rng.Value = "Volume"
       For Each nNode In oRoot.ChildNodes
    
     For Each lnode In nNode.ChildNodes
              

            Set rng = wks.Cells(intRowCounter, intColumnCounter)

           rng.Value = lnode.Text
           intColumnCounter = intColumnCounter + 1
     Next lnode
   
    Next nNode
    
    strFile = Dir
   
   Loop
    Set OL = Nothing
   
   

End Function

Friday, November 11, 2011

The Panes Collection Object


The Panes Collection Object

The Panes collection object is a property object of the Explorer object. The Panes collection object contains the three panes of the Outlook Explorer window, as shown in Figure 11-6. These are the Outlook Bar pane, the Folder List pane, and the Preview pane.
You can create an instance of an OutlookBarPane object from the Panes collection only. The Preview and Folder List panes are not accessible from the Outlook Object Model. When you navigate an Outlook Bar’s groups and shortcuts in code, you start with the Panes collection object, as demonstrated in the following code example:
Dim OlBarPane As Outlook.OutlookBarPane
Dim OlExplorer As Outlook.Explorer
Set OlExplorer = Application.ActiveExplorer
Set OlBarPane = OlExplorer.Panes("OutlookBar")
‘Make the Outlook Bar visible if it’s hidden
If OlBarPane.Visible = False Then
    OlBarPane.Visible = True
End If
MsgBox "The Current Outlook Bar Group is " _
  & OlBarPane.CurrentGroup, vbInformation
Figure 11.6 - Three Explorer panes comprise the Panes collection object.

Determining Whether a Pane is Visible

You can determine whether an individual pane is visible by using the IsPaneVisible method of the Explorer object. To make a pane visible, you use theShowPane method. The following VBScript code makes the Folder List pane visible:
Sub ShowFolderList
    Const olFolderList = 2
    Set objExpl = Application.ActiveExplorer
    If Not(objExpl.IsPaneVisible(olFolderList)) Then
        objExpl.ShowPane olFolderList, True
    End If
End Sub
You cannot size panes programmatically in the Explorer window in Outlook.

The OutlookBarPane Object

The OutlookBarPane object is the only object you can instantiate from the Panes collection object. It represents the Outlook Bar as well as its groups and shortcuts. Generally, you’ll create a reference to the OutlookBarPane object as a means to access its dependent child objects that represent Outlook Bar groups and shortcuts. You can use the CurrentGroup property of the OutlookBarPane object to set or get the current group on the Outlook Bar. The OutlookBarPane object supports two important events: BeforeNavigate and BeforeGroupSwitch. These events inform you when a user is navigating to a shortcut or a group, respectively. For additional information on writing event procedures as well as the events supported by the OutlookBarPane, OutlookBarGroups, and OutlookBarShortcuts objects, see Chapter 9.

The Outlook Window (Explorer Objects)


The Outlook Window (Explorer Objects)

The Explorer object represents the window in which the contents of a folder are displayed. The Explorers object is the parent collection object for Explorer objects. The following sections cover some of the methods and properties for the Explorer and Explorers objects.
Figure 11-5 illustrates elements of the Outlook user interface viewed from an object model perspective. This illustration is not meant to be all-inclusive; it shows just a few of the objects in the Outlook Object Model that you can manipulate programmatically.
Figure 11.5 - Object model components of the Outlook user interface.
For a complete list and description of the properties, methods, and events for the Explorer and Explorers objects, see Microsoft Outlook Visual Basic Reference Help.
Open the Explorer object item in the VBScript Samples folder to work directly with this code in Outlook.

Explorer Methods

Creating a New Explorer Window

Outlook supports an Explorers collection object. You can use the Explorers object to add a new Explorer window for a specific folder. Use the Display method to present the new Explorer window. The following example creates a new Explorer window for the Drafts folder by using the Add method and then shows the new window on the desktop in a normal window state.
Const olNormalWindow = 2
Sub DisplayNewExplorer_Click
    Set myExplorers = Application.Explorers
    Set myFolder = Application.GetNameSpace("MAPI").GetDefaultFolder(16)
    Set myOlExpl = myExplorers.Add(myFolder, 2)
    myOlExpl.Display

    myOlExpl.WindowState = olNormalWindow
End Sub

Explorer Properties

Returning the Active Folder

You can use the CurrentFolder property of the Explorer object to return the active folder in the Outlook window. The following example shows the name of the active folder in the message box when the DisplayTheCurrentFolder control is clicked:
Sub DisplayTheCurrentFolder_Click
    Set myExplorer = Application.ActiveExplorer
    MsgBox "The current folder in the Explorer is: " _
        & myExplorer.CurrentFolder.Name, vbInformation
End Sub

Obtaining the Current View for the Active Explorer

You can use the CurrentView property of the Explorer object to return or set the current view for the Active Explorer window. The example displays the name of the current view for the Active Explorer window.
Sub DisplayTheExplorerView_Click
    Set myExplorer = Application.ActiveExplorer
    MsgBox "The current Explorer view is: " & vbCr _
        & myExplorer.CurrentView, vbInformation
End Sub

Determining Which Items are Selected in the Explorer

The Selection collection object lets you know which items are selected in the Explorer window. The Selection object, in turn, contains an Items collection that lets you iterate over selected items. If you are writing VBA code, you can respond to the SelectionChange event of the Explorer object. The following example displays the number of selected items in the Active Explorer and then asks whether the user wants to display the items:
Sub DisplaySelectedItems_Click
    DisplayNewExplorer_Click
    Set mySelection = Application.ActiveExplorer.Selection
    MsgBox "The number of selected items in the Explorer is " _
        & mySelection.Count, vbInformation
    If MsgBox ("Display selected items?", vbYesNo+vbQuestion) = vbNo Then
        Exit Sub
    End If
    For i = 1 to mySelection.Count
        Set myItem = mySelection.Item(i)
        myItem.Display
    Next
End Sub

The NameSpace Object


The NameSpace Object

In Outlook, the NameSpace object represents the MAPI message store. The NameSpace object provides methods for logging on or off Outlook, referencing a default folder, and returning objects directly by ID. In addition, the NameSpace object provides access to a variety of methods and properties that are not normally available with the Application object.
For a complete list and description of the methods, properties, and events for the NameSpace object, see Microsoft Outlook Visual Basic Reference Help.
Open the NameSpace object item in the VBScript Samples folder to work directly with this code in Outlook.

NameSpace Object Methods

This section covers the GetDefaultFolder method and the dial method of the NameSpace object.

Returning a Default Folder

You can use the GetDefaultFolder method of the NameSpace object to access folders in the root folder, also known as the Mailbox. To reference a folder in the Mailbox, you can either specify a numeric value as the argument in the GetDefaultFolder method or copy the olDefaultFolders constants from the Outlook Constants item in the VBScript Samples folder and paste them into your code. The table lists these numeric values.
The following example uses the GetDefaultFolder method of the NameSpace object to return the Contacts folder and then display it:
Sub CommandButton1_Click
    Set MyFolder = Application.GetNameSpace("MAPI").GetDefaultFolder(10)
    MyFolder.Display
End Sub
FolderValue
Deleted Items
3
Outbox
4
Sent Items
5
Inbox
6
Calendar
9
Contacts
10
Journal
11
Notes
12
Tasks
13
Drafts
16

Dialing a Phone Number

The Dial method is new to Outlook 2002. If you supply a ContactItem as the argument to the Dial method, you will display the Outlook automatic phone dialer for that contact. The following code example uses the Dial method for the first ContactItem in your Contacts folder:
Sub DialPhone_Click()
    On Error Resume Next
    Dim objContactsFolder, objContactItem
    Const olFolderContacts = 10
    Set objContactsFolder = _
        Application.GetNamespace("MAPI") _
        .GetDefaultFolder(olFolderContacts)
    Set objContactItem = objContactsFolder.Items(1)
    If objContactItem Is Nothing Then
        MsgBox "Could not find a contact to dial." _
            , vbInformation
    Else
        Application.GetNamespace("MAPI").Dial (objContactItem)
    End If 
End Sub

Properties of the NameSpace Object

The NameSpace object provides two properties that you use quite often. These are the CurrentUser and Folders properties.

Returning the Name of the Current User

You can use the CurrentUser property of the NameSpace object to return the name of the currently logged-on user. This example shows the current user’s name in the message box when the CommandButton1 control is clicked:
Sub CommandButton1_Click
    Set MyNameSpace = Application.GetNameSpace("MAPI")
    MsgBox MyNameSpace.CurrentUser
End Sub

Referencing a Folder Collection

You can use the Folders property of the NameSpace object to reference the collection of folders in the MAPI NameSpace. The following example displays the number of subfolders in the Building Microsoft Outlook 2002 Applications .pst file:
Sub ReferenceAFolderCollection_Click
    Set MyNameSpace = Application.GetNameSpace("MAPI")
    set objFolder = _
        MyNameSpace("Building Microsoft Outlook 2002 Applications")
    Set colFolders = objFolder.Folders
    MsgBox "There are " & colFolders.Count & " subfolders" _
        & vbCr & "in " & objFolder.Name, vbInformation
End Sub

Selecting a Folder

You can use the PickFolder method of the NameSpace object to return a MAPIFolder object. The PickFolder method displays a dialog box for the user to select a folder from all available folders in the current profile. The following example displays the Select Folders dialog box and also displays an alert dialog box if the user clicks Cancel. If the user selects a folder, then the folder is displayed in an Explorer window.
Sub PickAFolder_Click()
On Error Resume Next
Set MyNameSpace = Application.GetNameSpace("MAPI")
Set objFolder = MyNameSpace.PickFolder
    If objFolder Is Nothing then
        MsgBox "User Pressed Cancel!", vbInformation
    Else
        objFolder.Display
    End If
End Sub
Figure 11.4 - This Warning dialog box appears when you attempt to access the CurrentUser property of the NameSpace object.