We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在发送消息是,有时内容需要换行。建议可以对\n这样的换行符进行特殊处理,转化为Ctrl+Enter,实现内容换行。
The text was updated successfully, but these errors were encountered:
def SendMsg(self, msg, clear=True): '''向当前窗口发送消息 msg : 要发送的消息 clear : 是否清除当前已编辑内容 ''' # 对发送信息分割 msg_list = msg.strip().split('\n') # print(msg_list) self.UiaAPI.SwitchToThisWindow() if clear: self.EditMsg.SendKeys('{Ctrl}a', waitTime=0) # 判断发送信息长度,大于1条换行编写发送信息,其他单条发送信息 if len(msg_list) > 1: for tmp in msg_list: self.EditMsg.SendKeys(tmp, waitTime=0) self.EditMsg.SendKeys('{Ctrl}{Enter}', waitTime=0) else: self.EditMsg.SendKeys(msg, waitTime=0) # 回车发送信息 self.EditMsg.SendKeys('{Enter}', waitTime=0)
Sorry, something went wrong.
换行功能,实现见链接里的:2、常见问题:https://www.python-office.com/office/robot.html
No branches or pull requests
在发送消息是,有时内容需要换行。建议可以对\n这样的换行符进行特殊处理,转化为Ctrl+Enter,实现内容换行。
The text was updated successfully, but these errors were encountered: