HRESULT hr = CoInitialize(NULL); _ApplicationPtr myApp("InDesign.Application"); DocumentPtr myDoc = myApp->ActiveDocument; PagePtr myPage = myDoc->Pages->Item[1L]; TextFramePtr myTextFrame = myPage->TextFrames->Add(); // create frame on Page
myTextFrame->FillColor = SomeSwatch->Name;
SwatchesPtr mySwatches = myApp->Swatches;
double SwatchCount = mySwatches->Count; //get quantity of elements std::cout << SwatchCount << std::endl; // SwatchCount = 10 SwatchPtr mySwatch_1 = mySwatches->Item[1L]; _variant_t mySwatchName_1 = mySwatch->Name;
SwatchPtr mySwatch_1 = mySwatches->Item[2L]; // m_pInterface = 0x00000000
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)