Microsoft Word

28K

Solutions

21K

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

Hello All.  I have the code below that irudyk helped me with.  It works great.  It looks for "TBD" .  If they are in a Table, it gets the Section Number and the Title of the Table.
I need another piece of code to capture all of the data in the cell with the TBD.  The cell might have "TBD <5.1>" with other text..  I need to capture all of that data in a variable.
I am running this code out of MS Access.
Please see attached file.

Dim FindRange As Word.Range
Set FindRange = ActiveDocument.Range

FindRange ' TBD"
Do While FindRange.Find.Execute() = True
        pdPage = FindRange.Information(wdActiveEndPageNumber)
        Selection.Goto wdGoToPage, wdGoToAbsolute, pdPage
        pageNumberText = FindRange.Sections(1).Footers(WdHeaderFooterIndex.wdHeaderFooterPrimary).Range.Text

        If FindRange.Information(Word.WdInformation.wdWithInTable) = True Then

            +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
            strCaptureAllDataInTableCell = I need to capture all if the data in the cell once the TBD is found.
            +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
           
            strColumn = FindRange.Information(wdStartOfRangeColumnNumber)
            strRow = FindRange.Information(wdStartOfRangeRowNumber)
            strSectionNumberText = Trim(Selection.Range.ListFormat.ListString) & " " & Selection.Paragraphs(1).Range.Text
            FindRange.Tables(1).Cell(1, …
0
In the attached form, in the field for Superior Court of California, I put in numbers for the street address and they are in a gray field. When I do the same in the You Are Ordered to Produce... field for name and date, the gray shading disappears when I enter data. How can I make the gray shading stay when I enter data in any of those fields?
Deposition-Subpoena-For-Production-.docx
0
I am using MS Access 2016 / MS Word 2016.  I have a table in Access with several currency formatted fields.  When I mail merge those fields in MS Word, the currency formatting is lost.  Is there a way for me to modify the format in Access to have Word properly retain the currency formatting?  I have 700+ merge docs and I do not want to start adding currency switches to each merge field in the docs.  

All the formatting was preserved in this Access application I wrote about 20 years ago and now that I've upgraded from Office 2000 to 2016, this became a problem.  
Thank you in advance!  

Jason
0
Hello, Is it possible to script embeddable VBA for MS WORD that, instead of a direct hyperlink to URL, will point to CHROME then the URL?
0
I have a .docm form that I need to code to do the following on a button click:

1. Assign a FileName based data from the Content Controls.
--- This is working currently. ---
2. Save the file with the created FileName as a .pdf (preferably in the same path/folder as the original .docm file).
--- This is saving the .pdf in the user's Document folder instead of the same folder as the .docm. ---
3. Silently attach the newly created .pdf file and email with Outlook (users might be on desktop version or web/mobile version)
--- Currently, the .docm file is attached and emailed rather than the .pdf. ---
4. MsgBox the user to confirm form submission.
--- This is working currently. ---

The final attachment has to be a .pdf because the files will be mailed to a MIcrosoft Team site and test documents I've sent do not work on Teams if they are macro-enabled. I'd also be fine if there was a way to skip the email and save the file directly to a specific Team File Folder or SharePoint folder but I haven't been able to work out how to set the correct paths. I set myself up with a Test Team site and uploaded .docm file and viewing the properties shows the following: 2410_Lacey_Test>Documents>Test>TestFile2.docm Oddly, when I uploaded the .docm file myself, I can open and view the file but if I email a .docm to the Team site the document is unusable (hence the need for the attachment to be a .pdf).

My current test file code:


Open in new window

0
In creating a new paragraph style in MS Word, is it possible to associate a Section Break (New Page) with that style (I emphasise Section Break, not just a page break)?

What I want to do is modify the Heading styles (Format/Paragraph) to insert a Section Break (New Page) instead of just a plain page break. I need to be able to have the page numbering show the chapter number and the page number restart with the change of chapter number e.g. 1-1 to 1-10 then 2-1 etc.

Can this be done and if so how?

Advice appreciated.

Carl
0
I would like a macro for Word 2016 that searches through the file for each work order number, then checks for the work order number in Column A of an Excel list, and if found, then replaces the work order number in the Word file based on the value listed in Column C of the Excel list. (Column C is a formula that concatenates Column A [the work order number] and Column B [initials]).

Additional notes:
  • Excel spreadsheet is in a table format
  • Column A and Column C are dynamic named ranges, as the number of work orders listed in the spreadsheet will change/fluctuate
  • I would like the original formatting of the work order number in Word to be retained when the work order number is updated in the file.
  • If the work order is not found in Column A of the Excel file, then no action is required in the Word file.

The format of the work order number is:
 ####-####### (4 numbers, followed by a dash, then 7 numbers)

I have attached the following files:
1. Cycle_Changes_Depot.docx
2. WO_Initials_List.xlsm
3. Cycle_Changes_Depot_After_Update.docx (this is an example file of the results I am looking for after the macro is run)

I hope I've included all the relevant information/files. Please let me know if you have any questions or need anything further.

Thanks!
Andrea
Cycle_Changes_Depot.docx
Cycle_Changes_Depot_After_Update.docx
WO_Initials_List.xlsm
0
This is question 3 of 3 that I am asking.   Microsoft Word 2016 VBA.  I am using fake data because I can't put company data out here.

I will be searching for "TBDs".  If it is found in a table, I need to capture the Title of the Table in a variable.
I already have code to let me know that it is in a table.
In the attached file, I need to capture "TABLE C-1  TO BE DETERMINED ITEMS" in a variable.

Thanks
WonHop
EE_Sample_01.docx
0
This is question 2 of 3 that I am asking.   Microsoft Word 2016 VBA.    I am using fake data because I can't put company data out here.

I have code that finds the words that I need.  I will do a search and find "TABLE C-1"  
When it finds  "TABLE C-1", I need to identify the Table directly below the Text.  Once it is identified, I need to set focus/put the cursor in the first cell so that I can get all of the data from the table.  I have found code that will go thru the table can get the data.

Please see the attached file.

Thanks
WonHop
EE_Sample_01.docx
0
This is question 1 of 3 that I am asking.   Microsoft Word 2016 VBA.   I am using fake data because I can't put company data out here.

I am trying to capture the Section Number is a variable.  The code listed below is NOT the code I need.  It captures the Section Number per the Word Document.
strCurrentSectionNumber = Selection.Information(wdActiveEndSectionNumber)

I need to capture the Section that used by the user.  Ex. 1.0 or 1.0.1

I have code that finds all TBDs.  When they are found, I need to capture where they are located in the document.
Please see the attached file.  I  need to capture "1.1  STAGE 88-6 REQUIREMENTS".

Thanks
WonHop
EE_Sample_01.docx
0
In microsoft word 2013, there is a footer with the version date such as February 14, 2019 shown as 20190214 (format yyyymmdd).  

QUESTION: On February 15, 2019, if someone changes the document and saves it, I want Word to update the date as 20190215.
How do i create a macro that does this?
0
I want to scan a document and use ocr so I can edit it in word 2016
0
This is hopefully just a setting in Word 2019, and hopefully I can explain this good.picture of screen I have to chose from when using screen shot option through Word 2019
A lady at work uses insert screen shots from the insert menu often, and from her PC the other screens she has open are not shown on the drop-down list compare to my PC. The lady claims she could see the open screen using Office 2016.

I’ve included a screen shot of the screen shot of what I see shown below in the insert screen shot…the other screens I have open.
0
How do you bold a word or two in a text box?
0
How to render only text into a word document using asp.net web forms ?

I am using the below code , but, it is rendering with <html> tags :

 
Response.Clear();
                Response.Buffer = true;
                Response.ContentType = "application/vnd.word";
                Response.ContentEncoding = System.Text.Encoding.UTF7;
                Response.AddHeader("Content-Disposition", "attachment;filename=xyz.doc");
                Response.Charset = "";
                EnableViewState = false;
                System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
                oStringWriter.Write(txtDetails.Text);
                System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
                PanelControlId.RenderControl(oHtmlTextWriter);
                Response.Write(oStringWriter.ToString());
                HttpContext.Current.ApplicationInstance.CompleteRequest();

Open in new window


I want only text to be rendered in word and not with html tags. Please help .
0
The toolbar / navigation on my Word program is messed up.  See picture.  I've restarted the program a couple times but the display is still bad.  I can minimize and close the program where one would normally assume the buttons would be located, but I would like to have the display back to its normal self!

Screenshot_1.png
0
Can't Get this Macro to work.  Worked just ONCE.  Then, stopped.  What do you think is happening?

From this question: https://www.experts-exchange.com/questions/29076881/Word-Macro-for-Shift-F3-Like-Auto-Capitalization-That-Skips-the-Words-And-But-Or-For-and-To.html

Option Explicit

Sub SetTitlecase()
    Dim strLowerWords() As String
    Dim strProperWords() As String
    Dim rng As Range
    Dim rngWord As Range
    Dim i As Integer
    
    'set up except words
    strLowerWords() = Split("and,for,to,a,of", ",")
    
    ReDim strProperWords(UBound(strLowerWords))
    For i = 0 To UBound(strLowerWords)
        strProperWords(i) = UCase(Left(strLowerWords(i), 1)) & LCase(Mid(strLowerWords(i), 2))
    Next i
    
    'set range to work on
    Set rng = Selection.Range
    
    With rng
        'capitalise first letter of every word
        .Case = wdTitleWord
        
        'set first letter of minor words to lower case
        For i = 0 To UBound(strLowerWords)
            With rng.Find
                .Text = strProperWords(i)
                .Replacement.Text = strLowerWords(i)
                .MatchWholeWord = True
                .MatchCase = True
                .Execute Replace:=wdReplaceAll
            End With
        Next i
    End With
    
    'recapitalise first letter of sentences
    rng.Case = wdTitleSentence
End Sub

Open in new window

1
I bought a new computer, HP Pavillion, Windows 10.

Microsoft Word no longer offers the option of printing to pdf. I need to do that regularly.

My old computer, Windows 10, etc. allowed this, a VERY nice feature.

How do I get this back?

Thanks
0
Hello,

I use MS Word to send emails.  I also add attachments and enter info into the subject line.  If I save the file, close, and reopen it, the attachments disappear and subject line becomes the name of the file.  Is there a way to preserve those items?  Maybe it's a setting within Word?  I attached a screen shot so it's clear what I'm talking about.

screen shot
Thanks!
Joel
0
In Word 2016, you can reply to a comment in a document.  When you do, the reply is indented.

If I save the document and reopen it, that same reply is no longer indented.  Why?  Is there a way to control the Comment Balloon indentations?

Here is what it looks like when I reply to a comment

Comment Balloons showing as Indented
Here is what the same comment looks like after I save, close, and reopen the document:

Indentation removed
0
I've been working off an external hard drive for more than a year -- which is to say, I keep the word (2016) docs for my project on the drive, call them up from the drive, store them to the drive - not my internal HD. I do this so I can share the project with a co-author on the same home network. When I was working in Win7, all went smoothly. Then six months ago I got a new W10Pro rig. Now, often by not always, when I open my word doc from the ext drive, make a number of changes, then invoke FileSave (CTRL-S) a progress bar appear at the bottom of the program window and it takes several seconds to save the document. Hard to Google this, but in searching for an explanation, I stumbled on this and it made me uncertain about what I've been doing. Is this true about save to HD is bad practice:

Post from list
Thanks
0
I have a project whereby I want to show a list of items (about 180) that represent Word shape names or descriptions so that I can select any one of them and have the code create that shape in the Word document. I also want to add option buttons to the userform that can filter that list according to shape categories such as “Basic Shapes”, “Flowcharts”, “Callouts”, etc. (about 10 such filters). I believe I would need a three-dimensional array to populate the listbox, with the first column being the shape name/description, the second the shape category, and the third the VBA shape enumerator, so I can use that in the code that creates the shape in the document (but I want the listbox to show only the name/description). Clicking one of the option buttons would then filter the listbox to show only the shape name/descriptions in that category, and selecting an item will then assign its shape enumerator to a variable that I can then use in the code that creates the shape.

Arrays are great but I am not at all good at creating them, and I’ve been unable to find examples online that I can adapt for this project. Can someone give me a start here?
0
How to open a word document on an ASP.NET  website page inside a popup or a text area in ASP.NET forms application without using silverlight ?
The document should be formattable and editable and can be update on click of a button in the web page . It can also be downloadable in locally on click of download button. Please help.
0
Customized setting in Microsoft word like default spacing short cut keys font size reset after I log off from my computer

Is there any way customized setting stays in my word document after I log off from my computer
0
Currently experiencing an issue with Microsoft Office Word 2016.

Trying print a document in a booklet format within Word but when the item is sent the printer some images are missing. Ran system restore, repaired, uninstalled word. Cleared temp files & ccleaner but unable to get these images to print.

The client has also tried to reprint other files in the same style which previously worked and have remained unused since they were last printed and these no longer print correctly either.
0

Microsoft Word

28K

Solutions

21K

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.