2014-05-14 4 views
0

엑셀 시트를 html 파일로 변환합니다. 어떤 경우에는 음성 열람이 일부 열에 추가되었으므로 변환 된 html 파일에서 음성을 원하지 않습니다. 어떻게 변환하는 동안 이러한 음성학을 제거 할 수 ...? 프로그래밍 방식으로 음성학을 끌 수있는 방법이 있습니까? 여기 코드 나는 Excel 개체에서 음성학 Turned off을 설정할 수있는 방법이 있나요엑셀 시트에서 음성학 제거

xApp = new Microsoft.Office.Interop.Excel.Application(); 
object missing = Type.Missing; 
object trueObject = true; 
xApp.Visible = false; 
xApp.DisplayAlerts = false; 
xWorkBook = xApp.Workbooks.Open(ExcelFilePath, missing, trueObject, missing, missing, missing, 
        missing, missing, missing, missing, missing, missing, missing, missing, missing); 
object format = Microsoft.Office.Interop.Excel.XlFileFormat.xlHtml; 

ConveredFilesPath = Path.Combine(outputDirTemp, ExcelFileName); 

string tempFileName = ConveredFilesPath + ".html"; 
xWorkBook.SaveAs(tempFileName, format, missing, missing, missing, missing, 
       Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange, 
       missing, missing, missing, missing, missing); 
if(Directory.Exists(ConveredFilesPath+".files")) 
    ConveredFilesPath += ".files"; 
else 
    ConveredFilesPath += "_files"; 

for (int count = 1; count < xWorkBook.Sheets.Count + 1; count++) 
{ 
    processDetils.AddFileInfo((count).ToString(), ((Microsoft.Office.Interop.Excel.Worksheet)xWorkBook.Sheets.get_Item(count)).Name); 
} 
CloseExcelObject(ref xWorkBook, ref xApp); 

을 사용하고? 여기 은 .. 데모의 영상이 엑셀은 굵은 글씨가 명확 일부 세포가하지 않는 최고 그러나 같은에 음성학을 볼 수 있습니다 다음 enter image description here

음성학에게 있습니다 파일 Me how에 의해 주어진 아이디어를 기반으로

+0

'음성학'을 정의 하시겠습니까? 어쩌면 예를 보여줄 수 있습니까? [''phonetic()'] (http://office.microsoft.com/en-gb/excel-help/phonetic-HP005250841.aspx) 함수를 의미합니까 ?? 네가 무엇을 요구하는지는 불분명하다. –

+0

phonetics에 의해 나는 (후리가나) 문자를 의미합니다 ... 나는 또한 pciture를 추가했습니다 .. –

+0

흠 ..'ActiveCell.Phonetics.Delete'와 같은 것에 대해 –

답변

0

입니다 난 통합 문서의 시트 수를 받고 다음 Phonetic.visible 재산 여기 false 을 설정하여이 문제를 해결 한 것은 그래서 지금 음성학은 변환에 표시되지 않습니다 코드를

Excel.Worksheet NwSheet; 
Excel.Range ShtRange; 
//Getting Number of total sheets in workbook 
int SheetCount = xApp.Sheets.Count; 
for (int i = 1; i <= SheetCount; i++){ 
NwSheet = (Excel.Worksheet)xApp.Sheets.get_Item(i); 
//Getting all used cells in sheet 
ShtRange = NwSheet.UsedRange; 
// hiding phonetics from sheet 
ShtRange.Phonetic.Visible = false; 
} 

입니다 html 파일 ...