Question: I have two email address. The first is `address1@domain.com.vn` and the second is `address2@domain.com.vn`. 

I want to copy email subject in microsoft outlook with second address `address2@domain.com.vn` to excel using vba. I use bellow code but it do not work.

```
Sub GetFromInbox()
Dim olapp As Outlook.Application
Dim olNs As Namespace
Dim Fldr As MAPIFolder
Dim olMail As Variant
Dim Pst_Folder_Name
Dim MailboxName
'Dim date1 As Date
Dim i As Integer
Sheets("sheet1").Visible = True
Sheets("sheet1").Select
Cells.Select
Selection.ClearContents
Cells(1, 1).Value = "Date"
Set olapp = New Outlook.Application
Set olNs = olapp.GetNamespace("MAPI")
Set Fldr = olNs.ActiveExplorer.CurrentFolder.Items
MailboxName = "address2@domain.com.vn"
Pst_Folder_Name = "Inbox"
Set Fldr = Outlook.Session.Folders(MailboxName).Folders(Pst_Folder_Name)
i = 2
For Each olMail In Fldr.Items
'For Each olMail In olapp.CurrentFolder.Items
ActiveSheet.Cells(i, 1).Value = olMail.ReceivedTime
ActiveSheet.Cells(i, 3).Value = olMail.Subject
ActiveSheet.Cells(i, 4).Value = olMail.SenderName
i = i + 1

Next olMail
End Sub

```

Answer: 
That output looks right to me.

`optind` is the index of the next argument to be processed. When you have all the options together, they're all in `argv[1]`, so `optind` remains at 1 until you've processed the `u` option. At that point, since everything in `argv[1]` has been consumed, `optind` is set to 2.

When the options are all in separate elements of `argv`, `optind` is always the index of the next argument to be processed.

See <http://man7.org/linux/man-pages/man3/getopt.3.html>.
Put this at the start of your program to see what is going on:

```
for (int i = 0; i < argc; ++i)
     printf("Param %d: %s\n", i, argv[i]);

```