//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); var worksheet = workbook.Worksheets[0]; worksheet.Range["1:14"].RowHeight = 40; worksheet.Range["A:A"].ColumnWidth = 15; worksheet.Range["B:B"].ColumnWidth = 10; worksheet.Range["C:C"].ColumnWidth = 10; worksheet.Range["D:D"].ColumnWidth = 10; worksheet.Range["E:E"].ColumnWidth = 15; worksheet.Range["F:F"].ColumnWidth = 25; worksheet.Range["A1:F1"].Merge(); worksheet.Range["A2:F2"].Merge(); worksheet.Range["A3:F3"].Merge(); worksheet.Range["A4:F4"].Merge(); worksheet.Range["D5:F5"].Merge(); worksheet.Range["E6:F6"].Merge(); worksheet.Range["A7:D7"].Merge(); worksheet.Range["A8:D8"].Merge(); worksheet.Range["E8:F8"].Merge(); worksheet.Range["A9:F9"].Merge(); worksheet.Range["A10:D10"].Merge(); worksheet.Range["E10:F10"].Merge(); worksheet.Range["A11:E11"].Merge(); worksheet.Range["A12:C12"].Merge(); worksheet.Range["A13:F13"].Merge(); worksheet.Range["A14:F14"].Merge(); worksheet.Range["B5:C5"].Merge(); worksheet.Range["C6:D6"].Merge(); worksheet.Range["A1"].Value = "Example Form"; worksheet.Range["A1"].Font.Bold = true; worksheet.Range["A1"].Font.Size = 30; worksheet.Range["A1"].Font.Name = "Arial"; worksheet.Range["A2"].Value = "Please open an account at"; worksheet.Range["A2"].Font.Bold = true; worksheet.Range["A2"].Font.Size = 18; worksheet.Range["A2"].Font.Name = "Arial"; worksheet.Range["A3"].Watermark = "BRANCH NAME"; worksheet.Range["A3"].CellPadding = new CellPadding(20, 0, 0, 0); worksheet.Range["A3"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["A3"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["A3"].LabelOptions.Margin = new Margin(2, 0, 0, 0); worksheet.Range["A3"].LabelOptions.Font.Size = 7; worksheet.Range["A3"].LabelOptions.Font.Name = "Arial"; worksheet.Range["A4"].Value = "Personal Details"; worksheet.Range["A4"].Font.Bold = true; worksheet.Range["A4"].Font.Size = 18; worksheet.Range["A4"].Font.Name = "Arial"; worksheet.Range["A4"].VerticalAlignment = VerticalAlignment.Bottom; worksheet.Range["A5"].Watermark = "MARITIAL STATUS"; worksheet.Range["A5"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["A5"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["A5"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["A5"].LabelOptions.Margin = new Margin(2, 0, 0, 0); worksheet.Range["A5"].LabelOptions.Font.Size = 7; worksheet.Range["A5"].LabelOptions.Font.Name = "Arial"; worksheet.Range["A5"].CellType = new CheckBoxCellType() { TextFalse = "Married", TextTrue = "Married", TextIndeterminate = "Married", TextAlign = CheckBoxAlign.Right, }; worksheet.Range["B5"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["B5"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["B5"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["B5"].LabelOptions.Margin = new Margin(2, 0, 0, 1); worksheet.Range["B5"].LabelOptions.Font.Size = 10; worksheet.Range["B5"].LabelOptions.Font.Name = "Arial"; worksheet.Range["B5"].CellType = new CheckBoxCellType() { TextFalse = "Single", TextTrue = "Single", TextAlign = CheckBoxAlign.Right, }; worksheet.Range["A6"].Watermark = "EDUCATION"; worksheet.Range["A6"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["A6"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["A6"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["A6"].LabelOptions.Margin = new Margin(2, 0, 0, 0); worksheet.Range["A6"].LabelOptions.Font.Size = 7; worksheet.Range["A6"].LabelOptions.Font.Name = "Arial"; worksheet.Range["A6"].CellType = new CheckBoxCellType() { TextFalse = "Under graduate", TextTrue = "Under graduate", TextAlign = CheckBoxAlign.Right, }; worksheet.Range["B6"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["B6"].CellType = new CheckBoxCellType() { TextFalse = "Graduate", TextTrue = "Graduate", TextAlign = CheckBoxAlign.Right, }; worksheet.Range["C6"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["C6"].CellType = new CheckBoxCellType() { TextFalse = "Others", TextTrue = "Others", TextAlign = CheckBoxAlign.Right, }; worksheet.Range["A7"].Watermark = "E-MAIL"; worksheet.Range["A7"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["A7"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["A7"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["A7"].LabelOptions.Margin = new Margin(2, 0, 0, 0); worksheet.Range["A7"].LabelOptions.Font.Size = 7; worksheet.Range["A7"].LabelOptions.Font.Name = "Arial"; worksheet.Range["E7"].Watermark = "MOBILE NO."; worksheet.Range["E7"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["E7"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["E7"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["E7"].LabelOptions.Margin = new Margin(2, 0, 0, 0); worksheet.Range["E7"].LabelOptions.Font.Size = 7; worksheet.Range["E7"].LabelOptions.Font.Name = "Arial"; worksheet.Range["F7"].Watermark = "EXISTING BANK ACCOUNT NO. (IF ANY)"; worksheet.Range["F7"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["F7"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["F7"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["F7"].LabelOptions.Margin = new Margin(2, 0, 0, 1); worksheet.Range["F7"].LabelOptions.Font.Size = 7; worksheet.Range["F7"].LabelOptions.Font.Name = "Arial"; worksheet.Range["D5"].Watermark = "FULL NAME"; worksheet.Range["D5"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["D5"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["D5"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["D5"].LabelOptions.Margin = new Margin(2, 0, 0, 1); worksheet.Range["D5"].LabelOptions.Font.Size = 7; worksheet.Range["D5"].LabelOptions.Font.Name = "Arial"; worksheet.Range["E6"].Watermark = "NATIONALITY"; worksheet.Range["E6"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["E6"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["E6"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["E6"].LabelOptions.Margin = new Margin(2, 0, 0, 1); worksheet.Range["E6"].LabelOptions.Font.Size = 7; worksheet.Range["E6"].LabelOptions.Font.Name = "Arial"; var celltype = new ComboBoxCellType { EditorValueType = EditorValueType.Text, }; celltype.Items.Add(new ComboBoxCellItem() { Text = "China", Value = "1" }); celltype.Items.Add(new ComboBoxCellItem() { Text = "United States", Value = "2" }); celltype.Items.Add(new ComboBoxCellItem() { Text = "Japan", Value = "3" }); celltype.Items.Add(new ComboBoxCellItem() { Text = "Germany", Value = "4" }); celltype.Items.Add(new ComboBoxCellItem() { Text = "France", Value = "5" }); celltype.Items.Add(new ComboBoxCellItem() { Text = "England", Value = "6" }); worksheet.Range["E6"].CellType = celltype; worksheet.Range["A8"].Watermark = "IN CASE OF A MINOR PLEASE PROVIDE DETAILS"; worksheet.Range["A8"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["A8"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["A8"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["A8"].LabelOptions.Margin = new Margin(2, 0, 0, 1); worksheet.Range["A8"].LabelOptions.Font.Size = 7; worksheet.Range["A8"].LabelOptions.Font.Name = "Arial"; worksheet.Range["E8"].Watermark = "NAME OF FATHER/SPOUSE"; worksheet.Range["E8"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["E8"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["E8"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["E8"].LabelOptions.Margin = new Margin(2, 0, 0, 1); worksheet.Range["E8"].LabelOptions.Font.Size = 7; worksheet.Range["E8"].LabelOptions.Font.Name = "Arial"; worksheet.Range["A9"].Value = "Residential address"; worksheet.Range["A9"].VerticalAlignment = VerticalAlignment.Bottom; worksheet.Range["A9"].Font.Size = 18; worksheet.Range["A9"].Font.Name = "Arial"; worksheet.Range["A10"].Watermark = "FLAT NO. AND BLDG. NAME"; worksheet.Range["A10"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["A10"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["A10"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["A10"].LabelOptions.Margin = new Margin(2, 0, 0, 1); worksheet.Range["A10"].LabelOptions.Font.Size = 7; worksheet.Range["A10"].LabelOptions.Font.Name = "Arial"; worksheet.Range["A11"].Watermark = "ROAD NO./NAME"; worksheet.Range["A11"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["A11"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["A11"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["A11"].LabelOptions.Margin = new Margin(2, 0, 0, 1); worksheet.Range["A11"].LabelOptions.Font.Size = 7; worksheet.Range["A11"].LabelOptions.Font.Name = "Arial"; worksheet.Range["E11"].Watermark = "CITY"; worksheet.Range["E11"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["E11"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["E11"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["E11"].LabelOptions.Margin = new Margin(2, 0, 0, 1); worksheet.Range["E11"].LabelOptions.Font.Size = 7; worksheet.Range["E11"].LabelOptions.Font.Name = "Arial"; worksheet.Range["A12"].Watermark = "TELEPHONE RESIDENCE"; worksheet.Range["A12"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["A12"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["A12"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["A12"].LabelOptions.Margin = new Margin(2, 0, 0, 1); worksheet.Range["A12"].LabelOptions.Font.Size = 7; worksheet.Range["A12"].LabelOptions.Font.Name = "Arial"; worksheet.Range["D12"].Watermark = "OFFICE"; worksheet.Range["D12"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["D12"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["D12"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["D12"].LabelOptions.Margin = new Margin(2, 0, 0, 1); worksheet.Range["D12"].LabelOptions.Font.Size = 7; worksheet.Range["D12"].LabelOptions.Font.Name = "Arial"; worksheet.Range["E12"].Watermark = "FAX"; worksheet.Range["E12"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["E12"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["E12"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["E12"].LabelOptions.Margin = new Margin(2, 0, 0, 1); worksheet.Range["E12"].LabelOptions.Font.Size = 7; worksheet.Range["E12"].LabelOptions.Font.Name = "Arial"; worksheet.Range["F12"].Watermark = "PIN CODE"; worksheet.Range["F12"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["F12"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["F12"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["F12"].LabelOptions.Margin = new Margin(2, 0, 0, 1); worksheet.Range["F12"].LabelOptions.Font.Size = 7; worksheet.Range["F12"].LabelOptions.Font.Name = "Arial"; worksheet.Range["A13"].Value = "Referenced web site"; worksheet.Range["A13"].VerticalAlignment = VerticalAlignment.Bottom; worksheet.Range["A13"].Font.Size = 18; worksheet.Range["A13"].Font.Name = "Arial"; worksheet.Range["A14"].Watermark = "HELP MESSAGE"; worksheet.Range["A14"].CellPadding = new CellPadding(15, 0, 0, 0); worksheet.Range["A14"].LabelOptions.Visibility = LabelVisibility.visible; worksheet.Range["A14"].LabelOptions.ForeColor = Color.FromArgb(51, 51, 51); worksheet.Range["A14"].LabelOptions.Margin = new Margin(2, 0, 0, 1); worksheet.Range["A14"].LabelOptions.Font.Size = 7; worksheet.Range["A14"].LabelOptions.Font.Name = "Arial"; worksheet.Range["A14"].Hyperlinks.Add(worksheet.Range["A14"], "https://www.google.com/", null, "help", "Any question, please click here."); worksheet.Range["A1:F15"].Borders[BordersIndex.InsideHorizontal].LineStyle = BorderLineStyle.Thin; worksheet.Range["A1:F15"].Borders[BordersIndex.InsideHorizontal].Color = Color.Black; worksheet.Range["A1:F14"].Borders[BordersIndex.InsideVertical].LineStyle = BorderLineStyle.Thin; worksheet.Range["A1:F14"].Borders[BordersIndex.InsideVertical].Color = Color.Black; // Save to a pdf file workbook.Save("CellPaddingAndLabel.pdf");
' Create a new Workbook Dim workbook As New Workbook Dim worksheet = workbook.Worksheets(0) With worksheet.Range .Item("1:14").RowHeight = 40 .Item("A:A").ColumnWidth = 15 .Item("B:B").ColumnWidth = 10 .Item("C:C").ColumnWidth = 10 .Item("D:D").ColumnWidth = 10 .Item("E:E").ColumnWidth = 15 .Item("F:F").ColumnWidth = 25 .Item("A1:F1").Merge() .Item("A2:F2").Merge() .Item("A3:F3").Merge() .Item("A4:F4").Merge() .Item("D5:F5").Merge() .Item("E6:F6").Merge() .Item("A7:D7").Merge() .Item("A8:D8").Merge() .Item("E8:F8").Merge() .Item("A9:F9").Merge() .Item("A10:D10").Merge() .Item("E10:F10").Merge() .Item("A11:E11").Merge() .Item("A12:C12").Merge() .Item("A13:F13").Merge() .Item("A14:F14").Merge() .Item("B5:C5").Merge() .Item("C6:D6").Merge() End With With worksheet.Range!A1 .Value = "Example Form" .Font.Bold = True .Font.Size = 30 .Font.Name = "Arial" End With With worksheet.Range!A2 .Value = "Please open an account at" .Font.Bold = True .Font.Size = 18 .Font.Name = "Arial" End With With worksheet.Range!A3 .Watermark = "BRANCH NAME" .CellPadding = New CellPadding(20, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 0) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" End With With worksheet.Range!A4 .Value = "Personal Details" .Font.Bold = True .Font.Size = 18 .Font.Name = "Arial" .VerticalAlignment = VerticalAlignment.Bottom End With With worksheet.Range!A5 .Watermark = "MARITIAL STATUS" .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 0) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" .CellType = New CheckBoxCellType With { .TextFalse = "Married", .TextTrue = "Married", .TextIndeterminate = "Married", .TextAlign = CheckBoxAlign.Right } End With With worksheet.Range!B5 .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 1) .LabelOptions.Font.Size = 10 .LabelOptions.Font.Name = "Arial" .CellType = New CheckBoxCellType With { .TextFalse = "Single", .TextTrue = "Single", .TextAlign = CheckBoxAlign.Right } End With With worksheet.Range!A6 .Watermark = "EDUCATION" .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 0) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" .CellType = New CheckBoxCellType With { .TextFalse = "Under graduate", .TextTrue = "Under graduate", .TextAlign = CheckBoxAlign.Right } End With With worksheet.Range!B6 .CellPadding = New CellPadding(15, 0, 0, 0) .CellType = New CheckBoxCellType With { .TextFalse = "Graduate", .TextTrue = "Graduate", .TextAlign = CheckBoxAlign.Right } End With With worksheet.Range!C6 .CellPadding = New CellPadding(15, 0, 0, 0) .CellType = New CheckBoxCellType With { .TextFalse = "Others", .TextTrue = "Others", .TextAlign = CheckBoxAlign.Right } End With With worksheet.Range!A7 .Watermark = "E-MAIL" .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 0) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" End With With worksheet.Range!E7 .Watermark = "MOBILE NO." .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 0) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" End With With worksheet.Range!F7 .Watermark = "EXISTING BANK ACCOUNT NO. (IF ANY)" .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 1) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" End With With worksheet.Range!D5 .Watermark = "FULL NAME" .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 1) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" End With With worksheet.Range!E6 .Watermark = "NATIONALITY" .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 1) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" End With Dim celltype = New ComboBoxCellType With { .EditorValueType = EditorValueType.Text } With celltype.Items .Add(New ComboBoxCellItem With { .Text = "China", .Value = "1" }) .Add(New ComboBoxCellItem With { .Text = "United States", .Value = "2" }) .Add(New ComboBoxCellItem With { .Text = "Japan", .Value = "3" }) .Add(New ComboBoxCellItem With { .Text = "Germany", .Value = "4" }) .Add(New ComboBoxCellItem With { .Text = "France", .Value = "5" }) .Add(New ComboBoxCellItem With { .Text = "England", .Value = "6" }) End With worksheet.Range!E6.CellType = celltype With worksheet.Range!A8 .Watermark = "IN CASE OF A MINOR PLEASE PROVIDE DETAILS" .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 1) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" End With With worksheet.Range!E8 .Watermark = "NAME OF FATHER/SPOUSE" .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 1) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" End With With worksheet.Range!A9 .Value = "Residential address" .VerticalAlignment = VerticalAlignment.Bottom .Font.Size = 18 .Font.Name = "Arial" End With With worksheet.Range!A10 .Watermark = "FLAT NO. AND BLDG. NAME" .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 1) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" End With With worksheet.Range!A11 .Watermark = "ROAD NO./NAME" .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 1) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" End With With worksheet.Range!E11 .Watermark = "CITY" .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 1) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" End With With worksheet.Range!A12 .Watermark = "TELEPHONE RESIDENCE" .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 1) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" End With With worksheet.Range!D12 .Watermark = "OFFICE" .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 1) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" End With With worksheet.Range!E12 .Watermark = "FAX" .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 1) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" End With With worksheet.Range!F12 .Watermark = "PIN CODE" .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 1) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" End With With worksheet.Range!A13 .Value = "Referenced web site" .VerticalAlignment = VerticalAlignment.Bottom .Font.Size = 18 .Font.Name = "Arial" End With With worksheet.Range!A14 .Watermark = "HELP MESSAGE" .CellPadding = New CellPadding(15, 0, 0, 0) .LabelOptions.Visibility = LabelVisibility.visible .LabelOptions.ForeColor = Color.FromArgb(51, 51, 51) .LabelOptions.Margin = New Margin(2, 0, 0, 1) .LabelOptions.Font.Size = 7 .LabelOptions.Font.Name = "Arial" .Hyperlinks.Add(worksheet.Range!A14, "https://www.google.com/", Nothing, "help", "Any question, please click here.") End With With worksheet.Range("A1:F15").Borders(BordersIndex.InsideHorizontal) .LineStyle = BorderLineStyle.Thin .Color = Color.Black End With With worksheet.Range("A1:F14").Borders(BordersIndex.InsideVertical) .LineStyle = BorderLineStyle.Thin .Color = Color.Black End With ' save to a pdf file workbook.Save("CellPaddingAndLabel.pdf")