wordapp = win32com.client.Dispatch("Word.Application") # Create new Word Object wordapp.Visible = 0 # Word Application should`t be visible worddoc = wordapp.Documents.Add() # Create new Document Object worddoc.PageSetup.Orientation = 1 # Make some Setup to the Document: worddoc.PageSetup.LeftMargin = 20 worddoc.PageSetup.TopMargin = 20 worddoc.PageSetup.BottomMargin = 20 worddoc.PageSetup.RightMargin = 20 worddoc.Content.Font.Size = 10 worddoc.Content.Paragraphs.TabStops.Add (100) # I would like to bold the last concatenated string..."The number of ObjectID records copied....." if tifCounter2 < tifCounter: worddoc.Content.Text = "Number of Photo Files on the S:drive = " + str(tifCounter) + '\n' + "Number of Ecosite_P records that have an associated ObjectID record = " + str(counter) + '\n' + "Number of Photos copied to new Folder = " + str(tifCounter2) + '\n' + "The number of ObjectID records copied to the new folder does not match the records in the feature class. Please review" else: worddoc.Content.Text = "Number of Photo Files on the S:drive = " + str(tifCounter) + '\n' + "Number of records that have an associated ObjectID record = " + str(counter) + '\n' + "Number of files copied to new Folder = " + str(tifCounter2) + '\n' worddoc.Content.MoveEnd worddoc.Close() # Close the Word Document (a save-Dialog pops up) wordapp.Quit() # Close the Word Application
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.