Quite a number of articles giving tips and tricks on MS Word advice turning off automatic formatting when users get frustrated and want to stop MS Word from changing certain things that they type, for example, three dashes turning into a horizontal line, or automatically converting to the copyright symbol after typing (c).
There's a simpler solution without the need to go through all the hassle of turning automatic formatting off.
Just undo the typing, or Ctrl+z (the keyboard shortcut).
And next time if you need the horizontal line fast, you can still do it the three dashes way.
This and That
20 September 2018
15 September 2018
Filler Text for MS Word
Have you come across instances when you need filler text for your MS Word documents, especially when creating templates?
Instead of going to the browser, find a lorem ipsum generator, generate the text, copy, and then going back to MS Word and pasting it, you can do it in just one step. Type "=lorem(p,l)" in your document, where "p" == the number of paragraphs and "l" == the number of lines to generate.
And hit Enter.
Viola! It's like magic.
Instead of going to the browser, find a lorem ipsum generator, generate the text, copy, and then going back to MS Word and pasting it, you can do it in just one step. Type "=lorem(p,l)" in your document, where "p" == the number of paragraphs and "l" == the number of lines to generate.
And hit Enter.
Viola! It's like magic.
13 September 2018
MS Excel VBA - Copy hidden Excel worksheet contents to new workbook
Was trying to copy the contents of a hidden worksheet in an Excel to a totally new workbook and edit it via VBA and faced several issues.
- One can't copy contents from a hidden worksheet. The worksheet must be visible in order for it to be copied.
- After making it visible, and copying it, there were problems making it hidden again as the current active workbook is the new one instead of the original one.
So the solution is to
1) Make the hidden worksheet visible
2) Activate the original workbook
3) Hide the worksheet
4) Activate the new workbook with the copied sheet
Below's the code, hopefully can help someone who's facing the same problem out there.
- One can't copy contents from a hidden worksheet. The worksheet must be visible in order for it to be copied.
- After making it visible, and copying it, there were problems making it hidden again as the current active workbook is the new one instead of the original one.
So the solution is to
1) Make the hidden worksheet visible
2) Activate the original workbook
3) Hide the worksheet
4) Activate the new workbook with the copied sheet
Below's the code, hopefully can help someone who's facing the same problem out there.
Sub copyHidden()'Make hidden sheet visible for copying to new workbookSheets("hiddenSheet").Visible = TrueSheets("hiddenSheet").Copy
'activate the original workbook to hide the sheet againnewbook = Workbooks.CountWorkbooks.Item(newbook - 1).ActivateWorksheets("hiddenSheet").Visible = False
'activate the new workbook with the copied sheetWorkbooks(newbook).ActivateActiveSheet.Name = "copiedSheet"
'the rest of your code here
End Sub
28 July 2018
一首听似平凡的歌
听似平凡,其实一点也不平凡。
《只要平凡》 (电影《我不是药神》主题曲)
演唱: 张杰/张碧晨
也许很远或是昨天
在这里或在对岸
长路辗转离合悲欢
人聚又人散
放过对错才知答案
活着的勇敢
没有神的光环
你我生而平凡
在心碎中认清遗憾
生命漫长也短暂
跳动心脏长出藤蔓
愿为险而战
跌入灰暗坠入深渊
沾满泥土的脸
没有神的光环
握紧手中的平凡
此心此生无憾
生命的火已点燃
有一天也许会走远
也许还能再相见
无论在人群在天边
让我再看清你的脸
任泪水铺满了双眼
虽无言泪满面
不要神的光环
只要你的平凡
在心碎中认清遗憾
生命漫长也短暂
跳动心脏长出藤蔓
愿为险而战
跌入灰暗坠入深渊
沾满泥土的脸
没有神的光环握
紧手中的平凡
有一天也许会走远
也许还能再相见
无论在人群在天边
让我再看清你的脸
任泪水铺满了双眼
虽无言泪满面
不要神的光环
只要你的平凡
此心此生无憾
生命的火已点燃
19 May 2018
MS Word VBA - Remove Cross Reference Links
Those who use MS Word extensively would likely have come across docs that use the cross-reference link feature.
And sometimes, due to the document passing through many hands, and when it finally comes to you, you find that the cross-reference links are all in a mess, sometimes with Error! messages here and there.
Someone came to find me the other day, and his question was - Could you help me remove the cross-reference links, just the links, but retain the words?
Ok, so I searched the web, and saw a seemingly nifty solution: Ctrl+A, and then Ctrl+Shift+F9
We happily used this, only to find out moments later that the references for all the Figure and Table Captions were all gone as well! This meant that we are no longer able to create a List of Tables/Figures, and that if more tables and figures are to be added, we have to MANUALLY update all the table and figure numbers. Imagine the nightmare with over 100 of them, each. That's a total of more than 200. Gosh.
In desperation, I sought a solution via VBA. After much trial and error, I managed to come up with this. May this help anyone who needs it.
Sub RemoveCrossRefLink()Dim objDoc As DocumentDim objFld As FieldDim sFldStr As StringDim i As Long, lFldStart As Long
Set objDoc = ActiveDocument' Loop thru fields in the docFor Each objFld In objDoc.FieldsIf objFld.Type = wdFieldRef ThenobjFld.SelectSelection.Fields.UnlinkobjFld.UpdateEnd IfNext objFldEnd Sub
Subscribe to:
Posts (Atom)