Search This Blog
Wednesday, February 20, 2019
Get list of titles from within files
Neat trick to a relatively simple inquiry.
-----Original Message-----
From: Word-Pc List [mailto:WORD-PC@liverpool.ac.uk] On Behalf Of Karen Murri
Sent: Tuesday, February 19, 2019 6:20 AM
To: WORD-PC@liverpool.ac.uk
Subject: Get list of titles from within files
Hi all,
Hoping for a quick answer before I set someone to working on a putzy task. Windows 10, Word 2016
I have a pile of Word files that should all have a title in them (style = Title). I was hoping to set Windows Explorer to show said title so that I can pull the actual title, along with the file name, into a list. Unfortunately, the title is not appearing in the file properties.
Any ideas on how to quickly accomplish what I need - get a list of file names and their titles?
Thanks,
Karen
Sub ListFilesAndTitles()
'
' ListFilesAndTitles Macro
' The best solution is to create a temporary file and copy the data to the file. The modified macro below does that.
' Regarding sorting the results, it could be done in the macro by sorting the arrays but it would be simpler to sort the paragraphs in the temporary file.
' From: Word-Pc List [mailto:WORD-PC@liverpool.ac.uk] On Behalf Of Ken <kae0088@gmail.com>
' Sent: Wednesday, February 20, 2019 6:45 AM
' To: WORD-PC@liverpool.ac.uk
' Subject: Re: Get list of titles from within files
' Sub ListFilesAndTitles()
Dim aRange As Range
Dim fl As String
Dim flNames() As String
Dim fTitle() As String
Dim flCount As Long
Dim j As Long
Dim s As String
Dim mydir As String
Dim nextDoc As Document
mydir = InputBox("Directory")
If Right(mydir, 1) <> "\" Then mydir = mydir & "\"
flCount = 0
ReDim flNames(0)
ReDim fTitle(0)
fl = Dir(mydir & "*.doc*")
Do While fl <> ""
Set nextDoc = Documents.Open(FileName:=mydir & fl, Visible:=False)
Set aRange = Documents(fl).Range
With aRange.Find
.ClearFormatting
.Style = "Title"
If .Execute Then
flCount = flCount + 1
ReDim Preserve flNames(flCount)
flNames(flCount) = fl
ReDim Preserve fTitle(flCount)
fTitle(flCount) = aRange.Text
End If
End With
nextDoc.Close SaveChanges:=wdDoNotSaveChanges
fl = Dir()
Loop
If flCount = 0 Then
MsgBox "No files found that have a title style "
Exit Sub
End If
Documents.Add
For j = 1 To flCount
Selection.TypeText flNames(j) & " " & fTitle(j)
Next j
End Sub
Tuesday, February 19, 2019
Monday, February 18, 2019
Accolades for DX
https://bleacherreport.com/articles/2821333-wwe-rumors-chyna-triple-h-and-dxs-2019-hall-of-fame-induction-ad-video-leaks
Neat Trick - Macro to Combine Multiple Sheets to One - Excel
I'll address context in a moment.
Writing is such a difficult task and when I read clumsy or poorly worded words that are trying to convey instructions to the user, it raises an innate tendency to pontificate about what I perceive as clumsy or poorly worded words. Thus, I present step 5, which by itself means nothing:
I understood what the writer was striving for after the phrase front of all sheets, but not because it was written well. This is a suggested rewrite of step 5.
Now, some context. This was in my ExtendOffice email this morning and it is definitely a neat trick that I want to be able to refer to in the future:
This is the VB code (so I don't have to re-type it when I go looking for this post in the future.
Writing is such a difficult task and when I read clumsy or poorly worded words that are trying to convey instructions to the user, it raises an innate tendency to pontificate about what I perceive as clumsy or poorly worded words. Thus, I present step 5, which by itself means nothing:
5. Press F5 key to run the code, then a sheet named Combined will be created at the front of all sheets which has merge all contents across all worksheets.
I understood what the writer was striving for after the phrase front of all sheets, but not because it was written well. This is a suggested rewrite of step 5.
5. Press F5 key to run the code. A sheet named Combined is added to the front of all sheets with all content from the other worksheets in the Excel file.
Now, some context. This was in my ExtendOffice email this morning and it is definitely a neat trick that I want to be able to refer to in the future:
This is the VB code (so I don't have to re-type it when I go looking for this post in the future.
Sub Combine()
'UpdatebyExtendoffice
Dim J As Integer
On Error Resume Next
Sheets(1).Select
Worksheets.Add
Sheets(1).Name = "Combined"
Sheets(2).Activate
Range("A1").EntireRow.Select
Selection.Copy Destination:=Sheets(1).Range("A1")
For J = 2 To Sheets.Count
Sheets(J).Activate
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Offset(1, 0).Resize(Selection.Rows.Count - 1).Select
Selection.Copy Destination:=Sheets(1).Range("A65536").End(xlUp)(2)
Next
End Sub
Friday, February 15, 2019
I Disagree with the R on this
An Iowa senator who has tried repeatedly to ban traffic
enforcement cameras is taking
another shot at them this legislative session - and this time he has
reinforcements. Radio Iowa reports Sen. Brad Zaun, R-Urbandale, who has fought
the cameras for a decade, has reintroduced legislation to ban them. He is being
joined in his quest by fellow Republican Jake Chapman of Adel, the manager of
the bill, who has successfully used GPS technology from his private ambulance
service to challenge two traffic camera tickets issued to his vehicles. Meanwhile,
on the House side, a subcommittee this week advanced
a bill to prohibit the cameras. House Bill 125 states that, in July,
"all local ordinances authorizing the use of automated or remote systems
for traffic law enforcement shall discontinue."
I think there ought to be traffic cameras. I say that even though I received a ticket for speeding in that area of I-380 going through Cedar Rapids. In my opinion, if the cameras can assign tickets and free up the police to deal with other important things, then go for it. If you want to dispute the ticket, you can. Period. It's a great idea.
HanSig First Rehearsal
I set the embedded video below to "Private" to test out that youtube.com functionality. You should not be able to see it.
Thursday, February 14, 2019
When They are Vulnerable
https://bleacherreport.com/articles/2820848-tmz-jimmy-uso-arrested-on-disorderly-conduct-charges-mugshot-released
Wednesday, February 13, 2019
Grateful for My Health
While I don't eat right - there's a lack of fruits & veggies in my diet - I walk during breaks at work. In fact, before I begin my day, I typically set a timer on my cell phone and start this routine:
Yesterday, I walked in the training room area that's on the other side of the level I set in. My friend Pam was walking and we had a really GOOD discussion about teenagers and technology and sports and other topics. It helped push my daily total to a whopping 14587 steps for the day, which is good because my walking went from 14424 to 14587 after work (mainly because I didn't keep my cell phone in my pocket as I did some typical tasks like laundry & unloading the dishwasher).
I mention "my health" because I read this:
- go up a flight of stairs, walk two laps
- go up a flight of stairs, walk two laps
- go up a flight of stairs, walk multiple laps with my friend Jay
Yesterday, I walked in the training room area that's on the other side of the level I set in. My friend Pam was walking and we had a really GOOD discussion about teenagers and technology and sports and other topics. It helped push my daily total to a whopping 14587 steps for the day, which is good because my walking went from 14424 to 14587 after work (mainly because I didn't keep my cell phone in my pocket as I did some typical tasks like laundry & unloading the dishwasher).
I mention "my health" because I read this:
Debby Bell, 59, of West Liberty, works for University Housing and Dining at the University of Iowa to cover the cost of her husband's medical bills. CREDIT: LILY SMITH/THE DAILY IOWANA 58-year-old man has stage four chronic obstructive pulmonary disease, an intense respiratory failure disease that requires him to rely on an oxygen machine around the clock and prevents him from working. Much of his costly medical expenses for this disease, widelyknown as COPD, aren't covered by Medicare.So, his 59-year-old wife, Debby Bell, uses her health benefits as a University of Iowa employee to cover the cost of his checkups, prescriptions and medical machines that supply him oxygen and stimulate normal breathing. One prescription is for an inhaler that costs more than $500 a month. Checkups are required every six months and include an echocardiogram costing $1,500."There's no way a normal person can pay that," Ms. Bell said. "Even someone with a much better job than I have ... you could go broke real quick."Ms. Bell is one of many Iowans nearing retirement age who are remaining in the workforce because of the high cost of health care that their life savings cannot cover. The Pew Research Center reports that 10,000 baby boomers hit retirement age every day.The youngest are starting to retire at age 54, according to the senior advocacy group, AARP. But most aren't leaving the labor market. The number of boomers in the work force shows a steady 4.5 percent increase since 2014, the U.S. Bureau of Labor Statistics reports. An estimated 9.7 million Americans age 65 and older remain in the U.S. workforce, the U.S. Census Bureau reported last year.Ms. Bell and her husband, Jeffrey, live in West Liberty. Without the health benefits that go with Ms. Bell's employment at the University of Iowa's Burge Market Place, the couple would not have been able to pay their mortgage or utility bills, she said. She is approaching retirement but fears it won't be an option if she doesn't have decent health insurance to supplement Medicare and cover prescription medicines for her and her husband.To read the full report from Iowa Watch writer Nichole Shaw and The Daily Iowan, click here. This story was produced by the Iowa Center for Public Affairs Journalism-IowaWatch.org, a nonprofit, online news website that collaborates with Iowa news organizations to produce explanatory and investigative reporting, with assistance from The Daily Iowan.
Subscribe to:
Posts (Atom)

Legislators revive plans for traffic cam ban 






