在VBA中删除Outlook约会 [英] Deleting an Outlook Appointment in VBA

查看:162
本文介绍了在VBA中删除Outlook约会的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试根据位置,开始日期,开始时间和时间的变量值删除Outlook预约。名称(主题)


我不知道如何从Outlook对象的声明开始。我在网上找到了一些代码并尝试改变它。你能帮忙看看在Outlook中找到约会的声明吗?我对编码的垃圾尝试如下: -

I am trying to delete an outlook appointment based upon the value of variables for Location, Start Date, Start Time & Name (Subject)

I am at a loss as where to start on declarations for Outlook Objects. I found some code on the Web and tried to alter it. Could you please help with the declarations for finding the appointment in Outlook. My rubbish attempt at coding is as follows:-

展开 | 选择 | Wrap | 行号

推荐答案

Cyd,你需要张贴问题小心。不只是转储代码并希望我们弄清楚问题应该是什么。描述你实际在做什么以及你遇到了什么。声明对我来说似乎很好,但你并没有真正提出一个问题。


关于项目的一般提示以及它们如何适合Outlook类结构可以通过在VBA IDE中使用对象资源管理器。您也可以从Access执行此操作,但可能更容易在本机应用程序中执行此操作。有关如何调用和播放的信息,请参见在VBA中进行调试
Cyd, you need to post the question with care. Not just dump code in and expect us to work out what the question should be. Describe what you''re actually doing and where you get stuck. The declarations seem fine to me, but you don''t really provide a question to work with.

General tips on items and how they fit into the Outlook class structure can be found by using Object Explorer within the VBA IDE. You can do it from Access too, but probably easier to do it in the native application. See Debugging in VBA for how to invoke and have a play.


Ok NeoPa对不起,如果我没有正确询问。我将尝试更好地解释。


我已成功设法使用以下子目录在Outlook中创建约会: -
Ok NeoPa Sorry if I am not asking correctly. I will try to explain better.

I have successfully managed to create appointments in Outlook using the following sub:-
展开 | 选择 | Wrap | 行号


这不是代码混淆了事情。缺乏任何可辨别的问题,甚至没有解释为什么代码存在。我确定我之前已将您与如何提问以及在发布无法按预期工作的代码时该怎么做。行号和错误消息是必要的,并解释正在发生的事情。所有这些重要因素都在问题中再次缺失。您还应该包含定义过程的代码,例如标题,以便当您引用删除子时,我不会再次查看所有代码,只是发现没有任何内容标识为''删除子''。我想这是你的第一段代码,但我坦率地说我不应该花时间猜测你应该告诉我什么。我想你也指的是第19行,但是所有的行都是编号的。如果您使用提供的数字,我不需要尝试阅读您的想法。


假设那么,它确实是您第一个发布的代码的第19行导致一些未指明的问题,我建议您在第19行断开代码并查看[AP_Date]和[AP_Start_Time]的字符串表示(在VBA中调试可能对此有所帮助)。我无法知道你在那里有什么数据所以我只能猜测。如果它们是以日期格式存储的有效日期和时间,您可以放弃:
It wasn''t the code that confused things. It was the lack of any discernable question or even explanation of why the code is there at all. I''m sure I''ve linked you before to how to ask questions and what to do when posting code that isn''t working as expected. The line number and error message are necessary as well as explaining what is going on. All these important elements are again missing from the question. You should also include the code that defines the procedure like the header so that when you refer to a ''Delete Sub'' I don''t go through all the code again just to find that nothing is identified as a ''Delete Sub''. I guess it''s your first bit of code, but I frankly ought not to be spending my time guessing what you should be telling me. I guess also you''re referring to line #19, but all the lines are numbered. If you use the numbers that are provided I don''t need to try to read your mind.

Assuming then, that it is indeed line #19 of your first posted code that is causing some unspecified problem, I would suggest that you breakpoint your code at line #19 and see what the string representations are of [AP_Date] and [AP_Start_Time] (Debugging in VBA may help with this). I have no way of knowing what data you have in there so I can only guess. If they are a valid date and time stored in Date format though, you may get away with :
展开 | 选择 | Wrap | 行号


这篇关于在VBA中删除Outlook约会的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆