Microsoft Word





Microsoft Word is a commercial document editing program that is part of the Microsoft Office suite. It features numerous text-editing tools for creating richly formatted documents, along with tools for the use of macros in Word documents. Word's native file formats are denoted either by a .doc or .docx file extension. Plugins permitting the Windows versions of Word to read and write formats it does not natively support, such as the OpenDocument format (ODF) are available. Word can import and display images in common bitmap formats such as JPG and GIF. It can also be used to create and display simple line-art.

Share tech news, updates, or what's on your mind.

Sign up to Post

I would like code against the KeyPress event of a TextBox in VBA application. I would like to detect which key has been pressed by the user when the user presses a key. I am wondering if there is way of doing that.
I would like in particular to know if the user has pressed the space key or a number key.
Thank you for your help.

Private Sub TextBoxI_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)

'need to know which key the user has pressed and take a an action based on the key pressed for example display a message box when the user presses space key.

End Sub

Open in new window

Having a Word template in which a Excel file is incorporated.
I need to be able to open the excel file and read the content of the cells in column A for not empty
and copy it into an other excel file, in which I will have a VLookup to retrieve the description of code in Column A.

I can't figure it out.  I don't know how to open the excel file into Word and be able to read in it.

Can you help please.
I would like to get all entries stored in my Word Autocorrect file (a file with the extension .acl") into an Excel sheet or in some other format such as .csv file so I can read data from it.
I am wondering if there is way for achieving this. I know you can use VBA to add auto correct entries to this file but I would like to do the opposite that is read data from the auto correct file. If it is not possible to do that using VBA, is there any other application or means through which I can open this .acl file and read data from it.
Thank you for your help.

I have a problem on Word and macros.

I use this macro :
Sub refresh()

    ActiveWindow.View.ShowFieldCodes = True
    ActiveWindow.View.ShowFieldCodes = False
End Sub

Open in new window

I want to run this macro with this .vbs:

Dim Word

Dim WordDoc

Set oArgs = WScript.Arguments

Set Word = CreateObject("Word.Application")

Word.Visible = False
Set WordDoc = Word.Documents.Open(oArgs(0))

Word.Run "refresh"





Open in new window

here the command I launch to execute this vbs :

cscript C:\refresh.vbs C:\Users\admin\Desktop\a.docx refresh C:\Users\admin\Desktop\b.docx

And nothing happen... here

C:\refresh.vbs(14, 1) Microsoft Word: command failed

Do you have a solution?

How do you remove a template from Word 2016?    I want to edit this document as a normal Word doc.
Say, please see the attached screen shot of a Microsoft Word document. The gray border surrounding the text is mine concern. How do I get rid of this? I cannot find what is causing this gray border around the text. Whichever Edit mode I chose, the gray border remains. It is something in the formatting, I would assume. Thanks, Shaun
I'm running Windows 10 on my Lenovo laptop, and while working in MS Word - suddenly - the up and down arrows start toggling my bold button.  How do I get rid of this?


New ticket for a closed issue (¬ificationFollowed=230273679#a42871864):
I have a macro to extract all text that has a user-defined style to a new document but also to include the numbering if the style is a numbering style. The latest version works very well for all but one style: Intense Reference. When I enter this style, the macro goes into an endless loop.  This was a problem on several styles in previous versions. This was fixed by an EE expert but for some reason, only the 'Intense Reference' style causes the endless loop. If this can be repaired, the macro will be good to go. I successfully tested the other styles in the table on p. 1 of the attached file.

i would like your professional advise .

to prepare a professional technical proposal to client or SLA document , what type of fonts do you recommend

1. Font Type on Header/ subheader / contents
2. Paragraph spacing
3. Any margin sizing etc

The image shows a word that we need for a church business card as well as a logo on the weekly bulletins. It's the word Celebration for English and Celebracion for the Hispanics.

Someone had the idea to put the T on top of the C and also change the T to a cross. So far the efforts have been in black fonts.

I suggested that most crosses from the days of Jesus were made of wood and thus the cross could be a brown color. They have played around with moving the cross (which is actually the T in celebration) to the left or right to somehow not distort the C.

In my opinion there will be enough other text on the card in Spanish and if the Spanish version of celebration is celebracion then any one viewing the card will know what celebration means. But I do not make the decisions.

So looking for more brain power on how to combine celebration and celebracion? Using colors, fonts, etc.

I'm designing the card and if we can get that word to the liking of the higher ups in the church then I will have to make the word be a photo so I can upload the photo (which will be nothing but the word) and drag that to the proper place on the card. The templates and editing do not offer a T on top of a C. Thanks.

We have a user with some issues opening Word documents. Word is showing a message every time it is opened that it is not the default app for documents, but it is set to default on all relevant file types. Icons are not showing as Word icons, instead showing as the default "white sheet" for documents, and in order to open a document from another program, the file has to be saved and opened independently. I have verified that his Office365 account is signed in correctly, run Office repair (Online), fully uninstalled Office then downloaded and installed a fresh version, and have had no change. This is also only happening on one profile, the Administrator profile seems to be working fine. Any thoughts?
The attached word has embedded an Excel object. If I add a column and  row in the Excel, the format and size of the content are changed. Any idea where I can keep the original size and format of the WORD ?

I need to set the datasource for a set of mail merge documents to deploy to users on and off the LAN and may have updates each month.

To save remoting and resetting up datasources etc... (and also guessing the location) I want to set the datasource location on load or via button.. probably both.

Will use a specifically named file in the downloads directory of the current user.

Please supply a routine that will change the datasource. Please put XYZ as the path and I will generate etc...

The experience is:

User opens the document... it does it then and then merges... AND .. can be done via button to do an update.

OK.. seems as though this is a starting point:

    With ActiveDocument.MailMerge

        .OpenDataSource Name:="c:\mydocs\contracts\MyCont_R.CSV"
    End With

Open in new window

And . Execute if you want to mail merge as part of the routine

Any additional suggestions?

I have a user trying to create a form using Developer in Word, but when they try to set up the form to be “Filled in” it’s not allowing them to protect the document.  They receive the following message:

“Your machine isn’t set up for Information Right Management (IRM). To set up IRM, sign in to Office, open an existing IRM protected message or document or contact your help desk.”

What is IRM and why are they running into this issue?  How do I resolve it easily?
I want to convert any number that I highlight to a roman numeral in my Microsoft Word document.

I already know how to use Ctrl+F9 to insert a field, and type a formula in the brackets:  {=4\*ROMAN} and do an Alt+F9 to toggle between the results and the formula.


Question 1:  Instead of me manually typing out the formula every time, is there a way I can hightlight an existing number in the document, say 2019, and replace with with  {=2019\*ROMAN} ?

Question 2:  I noticed if I copy {=4\*ROMAN} and paste it to another area of my document, then change the 4 to a 10, the end result still is IV, instead of X.  How come Word does not use 10 instead of 4?
I have used a neat DLL by Alex Robbio called "MS Word Compare" succesfully on a 32bit WIn 7 machine, but I am unable to get it to work on a 64bit Win 10 machine. The DLL enables a user to compare two different MS Word documents - you highlight them in Windows Explorer, right click, and select the "Compare" line on the WE context menu and the DLL launches MS Word showing the differences between the two documents. See here

The problem is that on the 64bit machine that "Compare" line does not appear in the context menu.

I have registered the DLL, and when running Nir Soft's "ShellExView" it shows up as an enabled 32 bit shell extension.
Dear Experts:

I would like to have two code snippets to complement the below macro.

The first code snippet that should be placed right at the beginning of the below macro is to check whether the rightmost cell of the first row on the first table contains either the term 'Single Products' or 'Set'.
If yes, cut the term found (either 'Single Products' or 'Set') into the clipboard, if no, do nothing.

The second code snippet that is to be placed at the very end of the below macro is to check whether the clipboard contains either the term ('Single Products' or 'Set'), if yes paste the clipboard contents (either the term 'Single Products' or 'Set') into the rightmost cell of the first row on the first table, if no, do nothing.

Help is very much appreciated. Thank you very much in advance.

Regards, Andreas

Sub EE_code_snippets()

Dim t As Table
Dim r As Long
Dim tc As Long

tc = 1

Set t = ActiveDocument.Tables(1)

  For r = 1 To t.rows.Count
     If Left(t.Cell(r, t.Columns.Count).Range.Text, Len(t.Cell(r, t.Columns.Count).Range.Text) - 2) = "Set" Or _
     Left(t.Cell(r, t.Columns.Count).Range.Text, Len(t.Cell(r, t.Columns.Count).Range.Text) - 2) = "Single Products" Then
      t.Cell(r, 2).Select
          Selection.InsertBreak Type:=wdPageBreak
            tc = tc + 1
          Set t = ActiveDocument.Tables(tc)
        r = 1
      End If
  Next r
End Sub

Open in new window

Is there a way to print a list of all named bookmarks in Microsoft Word?
Microsoft Word:

Word experienced an error trying to open the file.
Try these suggestions.
*Check the file permission for the document or drive.
*Make sure there is sufficient free memory and disk space.
*Open the file with the Text Recovery converter.
URL to SharePoint site
Hi, i have a list of local candidates i need to send a message too. I will be sending this message by letter and physically posting

I have 107 odd candidates and I want to change the name, address and electoral region for each letter

Is it possible to run some code that can the variables in bold in my word document as per my excel sheet?

Many thanks
In a terminal server (RDP) server environment, one of our 100 users is having a problem with Word telling her "Sorry, another account from your organization is already signed in on this computer". Her Excel allows her to sign in, however - and other users are ok on Word and do not get this.  What would cause this?  Also - is there a way that an administrator can access her Crednential Manager entries on the server, in spite of the Control Panel being blocked for all non-admin users?  Because while logged in as this user, I am unable to get to the Control PAnel.  Thanks for your help.
I wrote a code in word with vba.
The first time after a restart with the computer, it creates many emails and i received a run time error. They are all in the background. If I click debug it brings me to the .Display.
When I execute the code a second time it works and the email are pop up and filled with the text.

I am using Windows 10 and Office 2013.

Dim olApp As Object, objMail As Object
Dim Text As String
Dim TempReceiver As Variant
Dim TempNames As Variant
Dim FinalSalutation As String

TempReceiver = Split(Receiver, "@")
TempNames = Split(TempReceiver(0), ".")
FinalSalutation = StrConv(TempNames(0), vbProperCase) & " " & StrConv(TempNames(1), vbProperCase)

     Set olApp = CreateObject("Outlook.Application")
     Set objMail = olApp.CreateItem(0)
        Text = "Dear " & FinalSalutation & "," & "{ENTER}" & "{ENTER}" & "I would like to request for our new employee " & Employee & " that he will receive own Business Cards." _
        & "{ENTER}" & "{ENTER}" & "Job Title " & "{TAB}" & "{TAB}" & "{TAB}" & JobTitle & "{ENTER}" & "Global Function " & "{TAB}" & "{TAB}" & GFunction & "{ENTER}" _
        & "Global Sub-Function " & "{TAB}" & "{TAB}" & GSubFunction & "{ENTER}" & "Line Manager " & "{TAB}" & "{TAB}" & "{TAB}" & LineManager & "{ENTER}" & "{ENTER}" _
        & "Thank you in advance." & "{ENTER}" & "{ENTER}" & "Kind Regards"
     With objMail
         .To = Receiver
         .Subject = Topic
        End With
      SendKeys Text

Open in new window


I have an application which "read" a word document and collect sentences or paragraphs that contain a number of keywords and save it in a memo field. Today I just collect the text but I would like to collect the formatting and show it in a textbox with Rich Text property for show the formatting. I have tried to use the word .formattedText propery of sentence or paragraph object without success.

Is it possible to do in vba (manually cut and paste seems to work) ? If yes how?

Thanks in advance.

I'm trying to figure out how to delete from my Word document, the row that I've highlighted in red in the example below. The content has been redacted, but the formatting symbols have been retained. Typically these formatting symbols relate to tables, but I'm not sure what they mean in this context. Regardless, I'd like to delete that line. So far, nothing that I've tried has worked.

I have a train of Gmail emails where many of the lines are very long.

I want to copy this set of emails over to MS Word so I can highlight the pertinent points & print them out.

When I copy to Word, the long lines are truncated.

I thought of editing in GMail by manually inserting CR, it wont' let me.

Any solutions?

I'd prefer NOT to show any of the email content on EE because t is sensitive in nature.

Any ideas?


Microsoft Word





Microsoft Word is a commercial document editing program that is part of the Microsoft Office suite. It features numerous text-editing tools for creating richly formatted documents, along with tools for the use of macros in Word documents. Word's native file formats are denoted either by a .doc or .docx file extension. Plugins permitting the Windows versions of Word to read and write formats it does not natively support, such as the OpenDocument format (ODF) are available. Word can import and display images in common bitmap formats such as JPG and GIF. It can also be used to create and display simple line-art.