Any ideas on a solution - I am using outlook 2016. I get a runtime error 4065 this command is not available at the Replace:=wdReplaceAll line. Hi Diane, I am trying to search and replace text in an email with nested tables. Open the VBA Editor by pressing Alt+F11 on your keyboard. In Outlook 2007 and older, it’s at Tools, Macro Security.Īfter you test the macro and see that it works, you can either leave macro security set to low or sign the macro. To check your macro security in Outlook 2010 and above, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. Replace:=wdReplaceAllįirst: You will need macro security set to low during testing. Body = strDynamicDL2 & vbCrLf & strDynamicD元 ItmAppt.Subject = strFullName & (" - ") & strPhone Set MyFolder = Session.GetDefaultFolder(9) StrDynamicD元 = ("Address: ") & strAddress StrAddress = ObjItem.HomeAddressStreet & ", " & ObjItem.HomeAddressCity & ", " & ObjItem.HomeAddressState & " " & ObjItem.HomeAddressPostalCode Set objApp = CreateObject("Outlook.Application") The original macro is at Outlook 2007 Calendar. Word offers Edit > Paste and Match Formatting, similar to Pages and other Apple software. In Microsoft Word, use one of several paste commands. The original macro this code sample came from collects data from all selected contacts and creates a string to use in a single appointment but I simplified it for this example. Word offers an option paste unformatted text. This method can be used with any word or phrase stored in a variable. This example creates appointments for the selected contact(s), adds their name and address to the appointment body then changes the font used for their name and address to 14 point bold. If objDoc.ProtectionType = WdProtectionType.wdAllowOnlyReading Then objDoc.UnProtect You need to set a reference to the Word object model in the VB Editor's Tools > References menu. This macro selects the opened message and changes the entire message to use a uniform font size (12pt in my example) and saves the change. If objInsp.EditorType = olEditorWord Then Select a block of text while composing a message and run the macro. To use, open the VBA Editor (Alt+F11) and paste the code into a module. I tested this macro in Outlook 2010 and Outlook 2013 it should also work in Outlook 2007. See How to use Outlook’s VBA Editor for help using the editor, setting security levels, and signing macros.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |