Cells'e Köprüler ekleyin

Cells’e Köprüler ekleyin

Aşağıdaki örnek kod, çalışma sayfasının hücresinin içine nasıl köprü ekleneceğini gösterir. Hücre aralığına da benzer şekilde köprü ekleyebilirsiniz. lütfen kontrol edinizçıktı excel dosyası bu kodla oluşturulmuş ve Microsoft Excel’deki çıktı excel dosyasını gösteren aşağıdaki ekran görüntüsü.

yapılacaklar:resim_alternatif_metin

Basit kod

//For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C
//Path of output excel file
StringPtr outputAddHyperlinksToTheCells = outPath->StringAppend(new String("outputAddHyperlinksToTheCells.xlsx"));
//Create a new workbook
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook();
//Get the first worksheet
intrusive_ptr<IWorksheetCollection> wsc = workbook->GetIWorksheets();
intrusive_ptr<IWorksheet> ws = wsc->GetObjectByIndex(0);
//Add hyperlink in cell C7 and make use of its various methods
intrusive_ptr<IHyperlinkCollection> hypLnks = ws->GetIHyperlinks();
int idx = hypLnks->Add(new String("C7"), 1, 1, new String("http://www.aspose.com/"));
intrusive_ptr<IHyperlink> lnk = hypLnks->GetObjectByIndex(idx);
lnk->SetTextToDisplay(new String("Aspose"));
lnk->SetScreenTip(new String("Link to Aspose Website"));
//Save the workbook
workbook->Save(outputAddHyperlinksToTheCells);