Home > Net >  Word PageSetup cannot copy
Word PageSetup cannot copy

Time:11-13

Such as: want to Fsinfos [0]. FullName page setup in the file is assigned to the current document in the second quarter, but

A, try the code below, no effect
 
Word. The Document oDocument_Other=App. The Documents. The Open (Fsinfos [0]. FullName);
Word. PageSetup ResultPageSetup=oDocument_Other. PageSetup;
ODocument. Sections [2]. PageSetup=ResultPageSetup;


Two, tried the following code, direct error
 
ODocument. Sections. [2]. PageSetup=oDocument_Other PageSetup. Clone ()


Three, the following code is feasible, but it's too hard (because there are too many attributes), I don't know can have good way?
 
ODocument. Sections [2]. PageSetup. TopMargin=28.3 f;
ODocument. Sections [2]. PageSetup. BottomMargin=14.15 f;
ODocument. Sections [2]. PageSetup. RightMargin=oDocument_Other. PageSetup. RightMargin;
ODocument. Sections [2]. PageSetup. LeftMargin=oDocument_Other. PageSetup. LeftMargin;

CodePudding user response:


Microsoft's own? May version problem

CodePudding user response:

reference 1st floor tangyanzhi1111 response:
Microsoft bring? May version problem

Yeah, just want to use the c # operation Word

CodePudding user response:

In word to record a macro, and then copy the code,

CodePudding user response:

NOPI in a recent study, the original poster can be downloaded to making Chou Chou, feeling pretty good also,

CodePudding user response:

https://github.com/tonyqus/npoi.git

CodePudding user response:

reference 4 floor alone DE cat replies:
NOPI in a recent study, the original poster can be downloaded to making Chou Chou, feeling pretty good also,

Thought, useless, reason:
1, has been in office, are already familiar with basic operations (though occasionally loading problem); And NOPI did not experience, but also learn
A feature is that there is no study for a plug-in power
2, the feeling is NOPI still not mature, such as printing function, no;
Consider it more mature, such as

Thank you for your advice,
  •  Tags:  
  • C#
  • Related