Skip to main content

Posts

Showing posts from 2017

Filter MsiInstaller installation in Event viewer

How to filter or check successful msi installation on a Windows system?
There are quite a lot of ways to filter event viewer, it will solely depend on the taste of the person doing the event viewer audit.
It can be done via PowerShell, XML query, or use command line tools and other methods which the Sys Admin feels comfortable doing.
But when it comes to auditing logs, it’s a tedious task and takes a lot of time and depends on the raw data that you have so you exactly know what you’re searching for.
Command line still a useful tool since it comes handy, you just open the command prompt window and type the command and get the output.
The hardest part is how you digest or do another filtering on the output since it might be convoluted with lots of data. But don’t depend on a single tool, make use of whatever you have on your system and other tools available on the net.
This command line below filters the MsiInstaller for event ID 1033.
wevtutil qe application /q:"*[System[Provider…

How to display Adobe PDF in full screen window

How to display a PDF using Adobe reader or Adobe editor in full screen window?

How to display a PDF in presentation mode just like a PowerPoint?

Displaying a PDF in full screen mode or in a borderless window with just the contents shown in the screen is quite simple and straight forward.

Why do you need to show a PDF in presentation mode?

One reason I have in mind is if you only have a PDF in hand that is neatly arrange and beautifully crafted and you need to present.

Well, if you will be in the same shoes. Just press Ctrl + L.

Yes, Ctrl key + Letter "L". Or ctrl + l key.

The PDF will be in presentation mode and every click of the  mouse it will go to the next page.

To exit or to return to the normal view window, just press "esc" key.

Ctrl + L key, works in Adobe 9 to the latest version.


Cheers..till next time…

================================ Free Android Apps:
Click on links below to find out more:
Catholic Rosary Guide  for Android:
https://play.google.com/store/apps…

Loop thru custom Textboxes name in VBA or VB.Net

Having a custom name in Textboxes, Listbox, ComboBox in VBA or VB.Net is a good strategy. So, it will be easy to debug the code or analyze the data.

If just relying on the default names is also good but it will get messy and it will be hard to control when there’s quite a few of textboxes, and list boxes. And the next person who will maintain the code will find it easier to debug or check the program when proper custom name is assigned to the controls. And that next person might be yourself. So, be gentle and be explicit in giving comments and assigning names to controls.

It doesn’t hurt to put a clear comment or an overview of what the piece of code does or what’s the input that the control is accepting. Because greediness breeds greediness, and it will bite back.

Anyway, to loop to all the custom or default names is quite easy.


Example, if there are 30 or more textboxes in a form. It can be done by a simple for loop like:

For x = 1 to 30

GetTboxvalue =    Me.Controls(“Textbox” & …

Add a user in command line in Windows and Linux

How to add a user via command line in Windows and Linux?

Adding a user whether in Linux or Windows requires the user have rights to create.

In Windows you must be a member of the administrator or other groups who has the rights to create a user.

In Linux you must be a root or either a member of the sudoers depending on what distro you are using.

In Windows to create  a local user in a Windows client operating system such as Windows 7 or Windows 10.

A one liner command can be issued to create a local user, using the command prompt Window at an elevated mode or administrator mode.

At the command prompt type:

Net user  "username" "password" /add

Net user  << this should be type like that it’s part of the command syntax while username and password, can be any data and of course /add is needed meaning the command is adding a user to the system.

Example: net user spiderbond 007-homeSp!dey /add

Command will add a user name called spiderbond and the password is 007-…

Set a graph or shape in Word behind text using VBA

How to set a graph or shape in Word so it stays behind the text using VBA?
In Word the option is to right click an object select wrap text and click the desired options such as behind text, in front of text and other options.
Setting a graph behind the text is quite useful, if you need to display some text that will be displayed together with the graph.
To do this via VBA is plain and simple, a one liner code.
ThisDocument.Shapes("NameOfTheChart").WrapFormat.Type = wdWrapBehind
wdWrapBehind is equal to set "Behind Text".
The one liner VBA code, of course it will apply to any shapes, circle, oval, square or other shapes not just a graph.
Code works on Word 2016, it may or may not word in previous version of  Word. 

Cheers. Till next time!


================================ Free Android Apps:
Click on links below to find out more:
Catholic Rosary Guide  for Android:
https://play.google.com/store/apps/details?id=com.myrosaryapp
http://quickbytesstuff.blogspot.sg/2014/09/how-t…

How to position a graph in word in a specific page?

Positioning a graph in word is necessary to put the graph in a page where the description or other supporting details for the graph will be placed.
But, how to place or put a graph in a specific page in a document?
By default, the graph will be generated in the first page of the document.
To position a graph in any page in the document is to create a bookmark.
If you know exactly where to put the graph, manually create a bookmark by clicking  “Insert” in the ribbon and selecting “Bookmark”.
After clicking “Bookmark” it will ask for a name and create any name to define the bookmark.
Once the bookmark has been named and created, you can call the bookmark via VBA.
Here’s the code to call and select a bookmark:
ActiveDocument.Bookmarks("graph1").Select
graph1 – is the name of the bookmark.
After selecting the bookmark via VBA, call the method to generate the chart.
Like:
'initialize and set graph type
 Set shp = ActiveDocument.Shapes.AddChart(xlXYScatterLines, -18, 80, 480, 3…

Linux list folders recursively

To list all folders on the root directory, type:
  ls -d /*
Sample Output:
/bin     /dev   /smsbackup  /lost+found  /mnt  /proc  /selinux  /tmp /boot    /etc   /lib        /media       /net  /root  /srv      /usr /cgroup  /home  /lib64      /misc        /opt  /sbin  /sys      /var
To list all folders on the current folder, one level depth only; type:
[xxx@mx var]$ ls -d */
Sample Output:
account/  cvs/    games/  local/  lost+found/  opt/       spool/  yp/ cache/    db/     gdm/    lock/  sms/        preserve/  tmp/ crash/    empty/  lib/    log/    nis/         run/       www/

List all folders and sub folders, 2 level depth or 2 level hierarchy; type:
[xxx@mx var]$ ls -d */*/
Sample Output:
cache/abrt-di/        lib/misc/        log/ConsoleKit/      run/portreserve/ cache/cups/           lib/mlocate/     log/cups/            run/rhsm/ cache/fontconfig/     lib/net-snmp/    log/sms/            run/saslauthd/ cache/foomatic/       lib/nfs/         log/gdm/             run/sepermit/ cache…

Word VBA to set x and y chart values

How to set X and Y values in Word VBA chart?

How to set vertical and horizontal values for a Word chart using VBA?

Code below assumes that you already have the necessary code to generate the chart.

This code below will only show how to set the X and Y values for a chart using VBA in a Word document.

Here's the code:

'Set value for Y axis or Vertical value

With cht.Axes(xlValue)

   .MinimumScale = 0
   .MaximumScale = 35
   .MajorUnit = 5
   .MinorUnit = 0

End With


' Set value for X axis or Horizontal value

With cht.Axes(xlCategory)

   .MinimumScale = 0
   .MaximumScale = 25
    .MajorUnit = 5
   .MinorUnit = 0    

End With




Cheers! Till next time.

Kindly help to fill out this survey:(social media effects)
https://1drv.ms/xs/s!AoHcvCpSMSIdjEuJzjCHl4sMh2su
================================ Free Android Apps:
Click on links below to find out more:
Excel Keyboard shortcuts guide https://play.google.com/store/apps/details?id=chrisjoms.myexcelapplicationguide
Linux Android App cheat sheet: https://play…

VBA Word change graph data point width

If you have been playing with the chart in Word or Excel you might encountered that the point on the graph is quite small.
If you need to adjust the data point on Word graph, you have two options do it manually or simply automate it at runtime using a VBA code.
Assuming you have all the necessary parameters that creates the graph via VBA, and you just need to adjust the data point you can use the code below, the code below was tested using Word 2016. It may not apply to older versions but I think logic should stay the same.
cht.SeriesCollection(1).Format.Line.Weight = 9.75
To do it manually, click on the data point and right click on it and select “Format Data Point”, click the bucket icon and change the width value.

Here’s the screen shot using Word 2016:

For the sake of completeness, the code will be something like this:
Dim shp As Shape Dim cht As Chart  
Set shp = ActiveDocument.Shapes.AddChart(xlXYScatterLines)   Set cht = shp.Chart
Dim wb As Excel.Workbook Dim ws As Excel.Worksh…

How to rename a chart in Word 2016

Do you want to check what’s the name of the chart in Word 2016?
Or you just want to rename the chart in Word 2016 to a name, that the chart represents?
Word 2016 default chart name is in sequence, like Chart1, Chart2, Chart3 and it follows this pattern depending on how may charts you have at your document.

If you have multiple charts in a word document, and you want the chart name it to something meaningful or what the chart itself is all about; it’s quite easy and straight forward to rename a chart, but the way to rename it is not conventional as the previous way of doing it in other version of office.
You can rename the chart via VBA code or using the GUI in Word itself.
To rename or check the name of the chart in Word 2016 or O365.
Click on the chart:

After clicking the chart, the "Chart Tools" will open at the Ribbon.
Click the "Chart Tools"  at the ribbon. Click on the "Format" tab.
Under Format tab, click on "Selection Pane", this will op…