Microsoft Word

27K

Solutions

20K

Contributors

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

Dear Experts:

I would like to add an additional column between the third and fourth column of all the tables of the current document (using VBA). All the tables have 4 columns

Moreover the newly added column should have a page field '{page}' in all of the cells , vertical and horizontal aligment is to be centered.

Help is much appreciated. Thank you very much in advance. Regards, Andreas
0
Free Tool: ZipGrep
LVL 12
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

How do I correct my code so that when I send an xml in string over a post that it does not loose the white space in between the attributes

Abbreviated code is as follows
Piece 1:  Word VBA Macro
                       ...
                        strBudgetRows = strBudgetRows & "<Detail BT20OBJ=""BT20.GLKKeyMaster"" Prop=""TitleDl""/>"
                        strBudgetRows = strBudgetRows & "<Detail BT20OBJ=""BT20.GLOObjMaster"" Prop=""ObjDl""/>"
                    strBudgetRows = strBudgetRows & "</ReportFormat>"
                strBudgetRows = strBudgetRows & "</ReportFetch>"
            strBudgetRows = strBudgetRows & "</Request>"
        strBudgetRows = strBudgetRows & "</NetSightMessage>"
    strBudgetRows = strBudgetRows & "</sbixml>"



    Set curlss = CreateObject("Microsoft.XMLHTTP")
    curlss.Open "POST", "https://", False
    curlss.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    curlss.send ("str=" & strBudgetRows)
   
    'curlss.responseText comes back with no spaces between attributes
    ActiveDocument.Tables(3).Cell(1, 1).Range.Text = curlss.responseText
   


Piece 2: Classic asp code
      dim strBudgetRows
      strBudgetRows = request("str")

      set xmlBudgetRows = Server.CreateObject("Microsoft.XMLDOM") : xmlBudgetRows.async = false : xmlBudgetRows.loadXml strBudgetRows
        response.write strBudgetRows
       
Piece 3:  XML is consumed in Piece 2 but the white space is gone, thus the .loadxml fails
0
Trying to create a dynamic drop down list in Word using VBA
MO Word 2013 Windows 7 Enterprise
Currently, when I click in the first drop down, nothing happens.  The first option shows, but I am not able to change it.  the second drop down is blank.
I thought I would be able to click in the first drop down, then select one of the four values.
I am using Legacy Drop Down Form Field.
using this as a tutorial:
https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_winother/drop-down-menu-in-word/1d4ce90e-f561-445f-9481-c7eab9493386
Here is my Word Doc with 2 drop downs.  
This is just to learn it, my actual project will be for the user to use many drop downs and the values will create a letter that can be sent to the client.  So depending on what the user selects, will populate the word document.  I could have used Adobe Pdf with javascript, but then I would be the only one who could update it.  I thought with word, the user could update any content themselves.  but I am open to other platforms.
This is my First Drop down, for the North, South, West and EastThis is my second Drop down.
Sub PopulateddState()
    Dim MyCase As String
    MyCase = ActiveDocument.FormFields("ddRegion").Result
    Select Case MyCase

    Case "North"
        With ActiveDocument.FormFields("ddState").DropDown.ListEntries
            .Clear
            .Add "Michigan"
      

Open in new window

0
Word VBA. Is it possible to Select multiple ranges?

I have a loop that, on each pass, refers to a different range. I want to Select these ranges on each pass (so that I can Delete them all in one hit).

Thanks
0
Sorry, newbie question!
In a 500 page Word document, I want to delete all text that I have assigned the Style "StyleToDelete".

Thanks
0
In my Word app I have a Table of Contents. It looks like this
My TOC
It won't update with VBA code. (It did update previously, but now it doesn't)
    ActiveDocument.TablesOfContents(1).Update

Open in new window


I tried doing it manually. References > Table of Content ....
And No! It does not update!

I also did Ctl-A and F9
Still nothing!

Thanks for any help
0
I have a question,
                                    Suppose that I have a table and the table contains a text column and column contains few rows and rows is:----
                                                                                           
                                                  the first row: ----               I am not sure what is this
                                                  The Second row:--            abs text row
                                                  The Third row:---              text column
                                                  The Fourth row:--             text

Question:----Write a query to display each row last word in this column.?
0
Is it possible to have a Windows 7 pc running Office Professional 2010, 2013 and 2016?
0
Hi,

Word issue emailed to me ...
Possible cause ?



I'm using Word 2016.

For example, this afternoon I worked on a doc, and then this evening I wanted to use it as a template for a similar doc. I meant to do a file/save as at the start and create a new doc, but I forgot. Then when I had finished making my new doc I just pressed save and saved over the old doc. I thought I would be able to retrieve an old version so that I could get my work from this afternoon, but everywhere I look on my Laptop it says that there are no older versions available.

I have checked my Autosave settings and they seem to be correct, i.e. it's set to save every 10 minutes, but I still can't get any older versions.

This happened to my before recently as well so I set up Google Drive and Google Docs to try to avoid this happening again, but even on Drive and Docs there don't seem to be any older versions available.

I don't know if there is some setting that is wrong on my laptop or if there is a problem with my Word.

I really don't want this to happen again because it loses me a lot of time, so any suggestions you have would be appreciated.

Thanks,
0
HI - I cannot sign into Word 2016 or Excel 2016 on my PC, I get error 0xCAA30194

Please see attached.

Makes no sense, I am connected to the internet.

Please help!
112.JPG
0
Free Tool: Site Down Detector
LVL 12
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

how to cross excel spreadsheet row.

Lets say i have 10 rows in excel spreadsheet called Proposals.

Lets say 7th proposal cancelled due to discussion with client.(if you see in attachment row 7 "Implement" in yellow crossed in one of other document...i want to do same way..not sure how to do)

how to put one line crossing it still people should see it in background.

please advise
CrossRow.png
0
I'm making this 2nd post of an earlier question, as I have more information and a better sample to attach.

In the sample Word doc I have Heading 1, 2 and 3. The code in Module1 will find each Heading  in sequence. This works for Heading 1 and 2, but not Heading 3.
I found that the reason is the existence of the table within the text below the Heading 3.

New information
It turns out that the problem occurs ONLY when the table is directly below the Heading.

I have attached a sample doc.HM-sample-for-EE2.docm
To see what I mean:
Run the code in Module1 by stepping through (F8).
See that it finds the first Heading 3. On the next time round the loop the code should select the next Heading 3. But instead it finds the same one.
This is because there is a table immediately below the Heading.
To test this, enter a line of text below the Heading. This time it will work.
To test further, change the find criterion to 'Heading 1' or 'Heading 2'. It will work.

QUESTION:
What is it that the doc has got that prevents Find from working as it should?

(Note: Martin, thanks for your valuable advice on coding. I shall apply them in future, although I haven't modified this sample)
0
In Word VBA, I'm trying to find a faster way of finding Headings than Find. I tried this but it finds the same 1st Heading each time round the loop. I'm obviously missing something easy. Thanks for help.
Sub FindHeadingsInSequence()

    Dim rngContent As Range
    
    Set rngContent = ThisDocument.Bookmarks("TheContent").Range
    
    Do
        rngContent.GoTo what:=wdGoToHeading, Which:=wdGoToNext, Count:=1, Name:=""
    
        MsgBox rngContent.Paragraphs(1).Range.Words(1).Text
    
    Loop

End Sub

Open in new window

0
In Excel I can fill an Array with the contents of a Range, like this.
arrMyArray = Range("A1:M1000")  

Open in new window

It is quick. Instantaneous.

If I want to do similar in Word with VBA, where I want to fill an Array with the text that are in an outline with styles Heading 1, 2, and 3, I have been using Find (by style). That works, but takes up to 30 seconds on a document that has 1,000 approx headings.

Is there an equivalent in Word with VBA that works the same way as in Excel? ie. Instantaneously populating an Array with the contents of an Outline.

Thanks
0
Windows 10. Word 2013.
The following happened:
Somehow the 'Track Changes' menu was turned on and changes which I had made began to appear in red with a line under them.  
In the 'Track Changes Menu there are two options: 'Track Changes', and 'Lock Changes'.
I selected 'lock changes' and deleted the text which showed in red and then re-entered the correction.
Now the red text with underlining no longer appears.
However on the left margin of the document there is a vertical line showing where the correction had been made. How do I get rid of this line (which appears in  left margin adjacent to  where changes have been made).
0
Hello Experts,

I'm making a mail merge doc based on an Access Query. The thing is, when I try to attach the query in the document it doesn't appear in the list of available queries.

Is it because the query relies on form parameters to execute, or is it because the document in question is a template?
0
Enabling Content to see a Word Doc

I was sent a Word Doc and want to see the contents, but am told to Enable Content.

I have no idea what that means.

I have a Mac Office latest version.

Word Message
Thanks
0
On my Word document I have styles "Heading 1", "Heading 2" and "Heading 3". The following loop takes the Selection to the next "Heading 1" in turn, as it should. "Heading 2" works as well. But when I run "Heading 3" it DOES NOT go to the next "Heading 3", but selects the same (first) one each time round the loop.

Do
        With rngContent.Find
         .ClearFormatting
         .Style = "Heading 1"
         .Execute Forward:=True
        End With

            rngContent.Paragraphs(1).Range.Words(1).Select

Loop

Open in new window


Ideally I would attach the document to find out what is 'odd' about "Heading 3". The document is provided by my client, styles are applied already by them (this is a 500 page specification for engineering works). Unfortunately, for reasons of confidentiality I can't attach it here for you to look at.

But can anyone suggest what reasons could be causing this odd behaviour? What can I check?

FYI: rngContent is the entire document.
0
One of our users is reporting that hyperlinks in a Word document they use keep changing. The hyperlinks are paths to folders on our file storage system. I wanted to extract all the hyperlinked paths so I can study this behavior. I found this page

https://www.extendoffice.com/documents/word/1411-word-select-copy-all-hyperlinks.html#a2

and used the VBA code to extract the underlying paths to a new document, but I need more than what this provides.

1. I would like VBA code to export the underlying paths to a .csv file in column A and I want the text which is associated with the respective hyperlink in column B.
2. The author of the code says it does not extract the hyperlinks in the same order as they occurred in the original document but I do want them in the original order.

Thanks,
Don
0
Free Tool: Port Scanner
LVL 12
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Word VBA - I'm using this code to Find text of Heading 1, 2 and 3 styles.

In a Do .... Loop

        With rngContent.Find
         .ClearFormatting
         .Style = "Heading 1"
         .Execute Forward:=True
        End With

Open in new window


As you can see it will only find ONE style. Is it possible to modify the Find to find "Heading 1" OR "Heading 2" OR "Heading 3"?

I know I can run it 3 times.  But I want the Headings to be found so that when I put them into an Array they are in the same order as they occur on the document. FYI the styles are an Outline in 3 levels.

Thanks
0
We have Windows 7 clients trying to open a .rtf file in Word. The file is in a shared folder on Windows 2008 R2 server.
When the file opens in Word a File in Use window pops up that says the file is locked for editing by 'another user'
Do you want to:
Open a Read Only copy
Create a local copy and merge your changes later
Receive a notification when the original copy is available

On the Server side I have checked the open files and there are no other instances of that file open. I have checked the folder hidden files and there are no leftover lock files from previous sessions.

On the Win 7 Client side I have made changes to Windows Explorer that include removing the preview pane, Organize, Layout, details option as well as Folder Options, view tab, uncheck option for Show pop-up description for folder and desktop items.

I can open the file with no pop up on a Windows 10 client machine.
0
Hello and Good Afternoon Everyone,

       I think this upcoming question has been addressed from earlier post, but, I am not entirely sure about that.  At any rate, I am wondering if it is possible to convert image based text to real text within Microsoft Word.  From earlier trials using scanned text, I have been under the impression that it is not 100% and often comes with many imperfections.  Perhaps there is a new program which can more accurately carry out this task.  If so, I am certainly interested in checking it out.

        Any shared thoughts, suggestions, and tips regarding my interest in converting image based text to real text within Microsoft Word will be greatly appreciated.

        Thank you

        George
0
OS=Windows 10.
Microsoft Word 2013.

If I click on icon on right of  question mark ('?') on Word 2013  top menu the following option appears.

'Show Ribbon Tabs and Commands'

Underneath this heading in smaller print is the following:

'Show Ribbon Tabs and Commands all the time'

So I click on the option hoping to have Tabs and Commands display all the time. But I find that this does not happen. Within a short time the tabls and commands ribbon disappears. This happens every time I restore it.

What must I do to really get  the Tabls and Commands to display ALL THE TIME.
0
I have the following code in a Word 2010 macro.  I need to loop this to the end of the document and cannot get it to work.  I've worked with loops before, but cannot get this one to work.

    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
        With Selection.Find
            .Text = "{  FILLIN """
            .Replacement.Text = ""
            .Forward = True
            .Wrap = wdFindContinue
        End With
                Selection.Find.Execute
                    Selection.Extend
        With Selection.Find
            .Text = """ \* MERGEFORMAT  }"
            .Replacement.Text = ""
            .Forward = True
            .Wrap = wdFindContinue
        End With
                Selection.Find.Execute
                    Options.DefaultHighlightColorIndex = wdYellow
                        Selection.Range.HighlightColorIndex = wdYellow
                            Selection.MoveRight Unit:=wdCharacter, Count:=1

Open in new window



Thanks in advance!
0
All of my office 2010 programs freeze  whenever I try to "open" or "save as".  The file explorer dialogue box never renders, and instead the entire program freezes.    This only started happening recently, never had problems before.   Powerpoint, Word, Excel....none of them will render the save/open file dialogue, they all freeze.  I tried a repair of the installation but to no avail.  Would love any suggestions.  

This is what generates in the event viewer:   "The program EXCEL.EXE version 14.0.7192.5000 stopped interacting with Windows and was closed. "
0

Microsoft Word

27K

Solutions

20K

Contributors

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.