Posts

VBA Code to find a record in the MS word mail merge

Image
MS Word mail merge has an option to navigate through the records. The below VBA code will help you to type and search the record within the MS word document area, you do not have to go to the menu bar. This code first resets the document to the first record. This is required as the mail merge navigation is only forward. That means the VBA code cannot traverse backward. Reads a text from TextBox which is placed within the document. If the keyword entered and the current record is matched, then the Active document is activated with the current record. With ActiveDocument.MailMerge  .DataSource.ActiveRecord = wdFirstRecord End With Dim numRecord As Integer Dim searchText As String searchText = TextBox1.Text Set dsMain = ActiveDocument.MailMerge.DataSource If dsMain.FindRecord(FindText:=searchText, Field:="Name") = True Then numRecord = dsMain.ActiveRecord End If End Sub Watch the complete step by step tutorial Download the Excel file and the word docum...

VBA Code to copy and paste the Content from excel to word

Image
There are situations where you may have to copy and paste some content from excel to word. And save the newly created document into disk. The below VBA code or a macro will help you to do that. It is a very simple code, it is being executed from MS Excel. The MS Word object Library should included. This library has to functionality to interact with MS word object.  To include MS word object library, go to Tools and then select References. Select the required object library as shown in the picture below.   To copy the VBA code follow the below steps Open excel and make your table ready. This steps is as per your requirement.  Press Ctrl + F11, this will open a Visual Basic editor.  Click on insert and then module.  Module1 will appear if do not have any  module. Paste the below code into this module  Go back to excel and your macro will appear under macros list. Select and click on Run to execute the macro.  Watch...

Cleaning up private docker registry

The solution to cleaning the unused docker registry layers is not straightforward, there is nothing readily available from docker. As more and more docker layers are pushed and tagged, it may be possible that there are image layers that may not be required. These unnecessary layers will consume a lot of storage space. This page describes the way to delete unused layers without disturbing the registry. I am going to explain how to clean up unused layers from docker registry using HTTP API V2 Docker HTTP API V2 More about HTTP API V2 The current version of the docker provides an option to interact with the images in the remote private registry using HTTP API version 2. Few useful Digest APIs List all the repositories available in the private registry CATALOG $ curl reg-server:5000/v2/_catalog Output ------ { "repositories" :[ "alpine","1_ubuntu_16.04" , "centos" , "centos6-build-test" , "centos6-build-qa...